NAME

AnyEvent::Mojo::Connection - An active TCP connection to AnyEvent::Mojo

VERSION

Version 0.1

SYNOPSIS

use AnyEvent::Mojo::Connection;

...

DESCRIPTION

Foreach connection to a " AnyEvent::Mojo " server, a AnyEvent::Mojo::Connection object is created.

This object keeps track of the current " Mojo::Transaction ".

If an error or EOF condition is detected while reading or writting to the client socket, or in case of a timeout, the socket is disconnected.

METHODS

new

The constructor accepts the following parameters:

sock

The client socket.

peer_host

The IP of the client.

peer_port

The TCP port number of the client.

server

The " AnyEvent::Mojo " server to whom this connection belongs to.

timeout

Number of seconds the connection will wait for data while reading.

If no data is sent, the connection is closed.

It returns the AnyEvent::Mojo::Connection object.

run

The run() method starts all the " AnyEvent::Handle " processing to read the next request, process it and write the response.

It returns nothing.

close

The close() method clears the current transaction, destroys the " AnyEvent::Handle " associated with this connection and closes the client socket.

request_count

Returns the total request count for the connection. In case of keep-alive requests, the request count grows beyond 1.

peer_host

Returns the IP address of the peer host.

peer_port

Returns the TCP port number of the peer host.

AUTHOR

Pedro Melo, <melo at cpan.org>

COPYRIGHT & LICENSE

Copyright 2008 Pedro Melo.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

5 POD Errors

The following errors were encountered while parsing the POD:

Around line 279:

L<> starts or ends with whitespace

Around line 282:

L<> starts or ends with whitespace

Around line 314:

L<> starts or ends with whitespace

Around line 333:

L<> starts or ends with whitespace

Around line 342:

L<> starts or ends with whitespace