… | |
… | |
159 | |
159 | |
160 | Some errors are fatal (which is indicated by C<$fatal> being true). On |
160 | Some errors are fatal (which is indicated by C<$fatal> being true). On |
161 | fatal errors the handle object will be destroyed (by a call to C<< -> |
161 | fatal errors the handle object will be destroyed (by a call to C<< -> |
162 | destroy >>) after invoking the error callback (which means you are free to |
162 | destroy >>) after invoking the error callback (which means you are free to |
163 | examine the handle object). Examples of fatal errors are an EOF condition |
163 | examine the handle object). Examples of fatal errors are an EOF condition |
164 | with active (but unsatisifable) read watchers (C<EPIPE>) or I/O errors. In |
164 | with active (but unsatisfiable) read watchers (C<EPIPE>) or I/O errors. In |
165 | cases where the other side can close the connection at will, it is |
165 | cases where the other side can close the connection at will, it is |
166 | often easiest to not report C<EPIPE> errors in this callback. |
166 | often easiest to not report C<EPIPE> errors in this callback. |
167 | |
167 | |
168 | AnyEvent::Handle tries to find an appropriate error code for you to check |
168 | AnyEvent::Handle tries to find an appropriate error code for you to check |
169 | against, but in some cases (TLS errors), this does not work well. It is |
169 | against, but in some cases (TLS errors), this does not work well. It is |
… | |
… | |
501 | AnyEvent::Socket::tcp_connect ( |
501 | AnyEvent::Socket::tcp_connect ( |
502 | $self->{connect}[0], |
502 | $self->{connect}[0], |
503 | $self->{connect}[1], |
503 | $self->{connect}[1], |
504 | sub { |
504 | sub { |
505 | my ($fh, $host, $port, $retry) = @_; |
505 | my ($fh, $host, $port, $retry) = @_; |
|
|
506 | |
|
|
507 | delete $self->{_connect}; |
506 | |
508 | |
507 | if ($fh) { |
509 | if ($fh) { |
508 | $self->{fh} = $fh; |
510 | $self->{fh} = $fh; |
509 | |
511 | |
510 | delete $self->{_skip_drain_rbuf}; |
512 | delete $self->{_skip_drain_rbuf}; |