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.98 by root, Thu Oct 2 15:11:01 2008 UTC vs.
Revision 1.99 by root, Thu Oct 23 02:41:00 2008 UTC

1470 @linger = (); 1470 @linger = ();
1471 }); 1471 });
1472 } 1472 }
1473} 1473}
1474 1474
1475=item $handle->destroy
1476
1477Shut's down the handle object as much as possible - this call ensures that
1478no further callbacks will be invoked and resources will be freed as much
1479as possible. You must not call any methods on the object afterwards.
1480
1481The handle might still linger in the background and write out remaining
1482data, as specified by the C<linger> option, however.
1483
1484=cut
1485
1486sub destroy {
1487 my ($self) = @_;
1488
1489 $self->DESTROY;
1490 %$self = ();
1491}
1492
1475=item AnyEvent::Handle::TLS_CTX 1493=item AnyEvent::Handle::TLS_CTX
1476 1494
1477This function creates and returns the Net::SSLeay::CTX object used by 1495This function creates and returns the Net::SSLeay::CTX object used by
1478default for TLS mode. 1496default for TLS mode.
1479 1497
1550 $handle->on_drain (sub { 1568 $handle->on_drain (sub {
1551 warn "all data submitted to the kernel\n"; 1569 warn "all data submitted to the kernel\n";
1552 undef $handle; 1570 undef $handle;
1553 }); 1571 });
1554 1572
1573=item I get different callback invocations in TLS mode/Why can't I pause
1574reading?
1575
1576Unlike, say, TCP, TLS conenctions do not consist of two independent
1577communication channels, one for each direction. Or put differently. the
1578read and write directions are not independent of each other: you cannot
1579write data unless you are also prepared to read, and vice versa.
1580
1581This can mean than, in TLS mode, you might get C<on_error> or C<on_eof>
1582callback invocations when you are not expecting any read data - the reason
1583is that AnyEvent::Handle always reads in TLS mode.
1584
1585During the connection, you have to make sure that you always have a
1586non-empty read-queue, or an C<on_read> watcher. At the end of the
1587connection (or when you no longer want to use it) you can call the
1588C<destroy> method.
1589
1555=back 1590=back
1556 1591
1557 1592
1558=head1 SUBCLASSING AnyEvent::Handle 1593=head1 SUBCLASSING AnyEvent::Handle
1559 1594

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines