ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Handle.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Handle.pm (file contents):
Revision 1.185 by root, Thu Sep 3 19:48:27 2009 UTC vs.
Revision 1.186 by root, Mon Sep 7 19:54:57 2009 UTC

129 129
130The actual numeric host and port (the socket peername) are passed as 130The actual numeric host and port (the socket peername) are passed as
131parameters, together with a retry callback. 131parameters, together with a retry callback.
132 132
133When, for some reason, the handle is not acceptable, then calling 133When, for some reason, the handle is not acceptable, then calling
134C<$retry> will continue with the next conenction target (in case of 134C<$retry> will continue with the next connection target (in case of
135multi-homed hosts or SRV records there can be multiple connection 135multi-homed hosts or SRV records there can be multiple connection
136endpoints). When it is called then the read and write queues, eof status, 136endpoints). At the time it is called the read and write queues, eof
137tls status and similar properties of the handle are being reset. 137status, tls status and similar properties of the handle will have been
138reset.
138 139
139In most cases, ignoring the C<$retry> parameter is the way to go. 140In most cases, ignoring the C<$retry> parameter is the way to go.
140 141
141=item on_connect_error => $cb->($handle, $message) 142=item on_connect_error => $cb->($handle, $message)
142 143
143This callback is called when the conenction could not be 144This callback is called when the connection could not be
144established. C<$!> will contain the relevant error code, and C<$message> a 145established. C<$!> will contain the relevant error code, and C<$message> a
145message describing it (usually the same as C<"$!">). 146message describing it (usually the same as C<"$!">).
146 147
147If this callback isn't specified, then C<on_error> will be called with a 148If this callback isn't specified, then C<on_error> will be called with a
148fatal error instead. 149fatal error instead.
304 305
305=item keepalive => <boolean> 306=item keepalive => <boolean>
306 307
307Enables (default disable) the SO_KEEPALIVE option on the stream socket: 308Enables (default disable) the SO_KEEPALIVE option on the stream socket:
308normally, TCP connections have no time-out once established, so TCP 309normally, TCP connections have no time-out once established, so TCP
309conenctions, once established, can stay alive forever even when the other 310connections, once established, can stay alive forever even when the other
310side has long gone. TCP keepalives are a cheap way to take down long-lived 311side has long gone. TCP keepalives are a cheap way to take down long-lived
311TCP connections whent he other side becomes unreachable. While the default 312TCP connections whent he other side becomes unreachable. While the default
312is OS-dependent, TCP keepalives usually kick in after around two hours, 313is OS-dependent, TCP keepalives usually kick in after around two hours,
313and, if the other side doesn't reply, take down the TCP connection some 10 314and, if the other side doesn't reply, take down the TCP connection some 10
314to 15 minutes later. 315to 15 minutes later.
374C<undef>. 375C<undef>.
375 376
376=item tls => "accept" | "connect" | Net::SSLeay::SSL object 377=item tls => "accept" | "connect" | Net::SSLeay::SSL object
377 378
378When this parameter is given, it enables TLS (SSL) mode, that means 379When this parameter is given, it enables TLS (SSL) mode, that means
379AnyEvent will start a TLS handshake as soon as the conenction has been 380AnyEvent will start a TLS handshake as soon as the connection has been
380established and will transparently encrypt/decrypt data afterwards. 381established and will transparently encrypt/decrypt data afterwards.
381 382
382All TLS protocol errors will be signalled as C<EPROTO>, with an 383All TLS protocol errors will be signalled as C<EPROTO>, with an
383appropriate error message. 384appropriate error message.
384 385

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines