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.160 by root, Fri Jul 24 22:47:04 2009 UTC vs.
Revision 1.161 by root, Sat Jul 25 06:16:45 2009 UTC

101attempted, but after the file handle has been created. It could be used to 101attempted, but after the file handle has been created. It could be used to
102prepare the file handle with parameters required for the actual connect 102prepare the file handle with parameters required for the actual connect
103(as opposed to settings that can be changed when the connection is already 103(as opposed to settings that can be changed when the connection is already
104established). 104established).
105 105
106The return value of this callback should be the connect timeout value in
107seconds (or C<0>, or C<undef>, or the empty list, to indicate the default
108timeout is to be used).
109
106=item on_connect => $cb->($handle, $host, $port, $retry->()) 110=item on_connect => $cb->($handle, $host, $port, $retry->())
107 111
108This callback is called when a connection has been successfully established. 112This callback is called when a connection has been successfully established.
109 113
110The actual numeric host and port (the socket peername) are passed as 114The actual numeric host and port (the socket peername) are passed as
444 } else { 448 } else {
445 if ($self->{on_connect_error}) { 449 if ($self->{on_connect_error}) {
446 $self->{on_connect_error}($self, "$!"); 450 $self->{on_connect_error}($self, "$!");
447 $self->destroy; 451 $self->destroy;
448 } else { 452 } else {
449 $self->fatal ($!, 1); 453 $self->_error ($!, 1);
450 } 454 }
451 } 455 }
452 }, 456 },
453 sub { 457 sub {
454 local $self->{fh} = $_[0]; 458 local $self->{fh} = $_[0];
455 459
460 $self->{on_prepare}
456 $self->{on_prepare}->($self) 461 ? $self->{on_prepare}->($self)
457 if $self->{on_prepare}; 462 : ()
458 } 463 }
459 ); 464 );
460 } 465 }
461 466
462 } else { 467 } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines