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.209 by root, Wed Dec 29 04:40:23 2010 UTC vs.
Revision 1.210 by root, Thu Dec 30 01:53:15 2010 UTC

114=over 4 114=over 4
115 115
116=item on_prepare => $cb->($handle) 116=item on_prepare => $cb->($handle)
117 117
118This (rarely used) callback is called before a new connection is 118This (rarely used) callback is called before a new connection is
119attempted, but after the file handle has been created. It could be used to 119attempted, but after the file handle has been created (you can access that
120file handle via C<< $handle->{fh} >>). It could be used to prepare the
120prepare the file handle with parameters required for the actual connect 121file handle with parameters required for the actual connect (as opposed to
121(as opposed to settings that can be changed when the connection is already 122settings that can be changed when the connection is already established).
122established).
123 123
124The return value of this callback should be the connect timeout value in 124The return value of this callback should be the connect timeout value in
125seconds (or C<0>, or C<undef>, or the empty list, to indicate that the 125seconds (or C<0>, or C<undef>, or the empty list, to indicate that the
126default timeout is to be used). 126default timeout is to be used).
127 127
546 }, 546 },
547 sub { 547 sub {
548 local $self->{fh} = $_[0]; 548 local $self->{fh} = $_[0];
549 549
550 $self->{on_prepare} 550 $self->{on_prepare}
551 ? $self->{on_prepare}->($self) 551 ? $self->{on_prepare}->($self)
552 : () 552 : ()
553 } 553 }
554 ); 554 );
555 } 555 }
556 556

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines