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.192 by root, Fri Mar 12 23:22:14 2010 UTC vs.
Revision 1.193 by root, Mon Mar 15 18:51:30 2010 UTC

832=item $handle->on_drain ($cb) 832=item $handle->on_drain ($cb)
833 833
834Sets the C<on_drain> callback or clears it (see the description of 834Sets the C<on_drain> callback or clears it (see the description of
835C<on_drain> in the constructor). 835C<on_drain> in the constructor).
836 836
837This method may invoke callbacks (and therefore the handle might be
838destroyed after it returns).
839
837=cut 840=cut
838 841
839sub on_drain { 842sub on_drain {
840 my ($self, $cb) = @_; 843 my ($self, $cb) = @_;
841 844
848=item $handle->push_write ($data) 851=item $handle->push_write ($data)
849 852
850Queues the given scalar to be written. You can push as much data as you 853Queues the given scalar to be written. You can push as much data as you
851want (only limited by the available memory), as C<AnyEvent::Handle> 854want (only limited by the available memory), as C<AnyEvent::Handle>
852buffers it independently of the kernel. 855buffers it independently of the kernel.
856
857This method may invoke callbacks (and therefore the handle might be
858destroyed after it returns).
853 859
854=cut 860=cut
855 861
856sub _drain_wbuf { 862sub _drain_wbuf {
857 my ($self) = @_; 863 my ($self) = @_;
1033This simply shuts down the write side and signals an EOF condition to the 1039This simply shuts down the write side and signals an EOF condition to the
1034the peer. 1040the peer.
1035 1041
1036You can rely on the normal read queue and C<on_eof> handling 1042You can rely on the normal read queue and C<on_eof> handling
1037afterwards. This is the cleanest way to close a connection. 1043afterwards. This is the cleanest way to close a connection.
1044
1045This method may invoke callbacks (and therefore the handle might be
1046destroyed after it returns).
1038 1047
1039=cut 1048=cut
1040 1049
1041sub push_shutdown { 1050sub push_shutdown {
1042 my ($self) = @_; 1051 my ($self) = @_;
1239 1248
1240This replaces the currently set C<on_read> callback, or clears it (when 1249This replaces the currently set C<on_read> callback, or clears it (when
1241the new callback is C<undef>). See the description of C<on_read> in the 1250the new callback is C<undef>). See the description of C<on_read> in the
1242constructor. 1251constructor.
1243 1252
1253This method may invoke callbacks (and therefore the handle might be
1254destroyed after it returns).
1255
1244=cut 1256=cut
1245 1257
1246sub on_read { 1258sub on_read {
1247 my ($self, $cb) = @_; 1259 my ($self, $cb) = @_;
1248 1260
1286available (or an error condition is detected). 1298available (or an error condition is detected).
1287 1299
1288If enough data was available, then the callback must remove all data it is 1300If enough data was available, then the callback must remove all data it is
1289interested in (which can be none at all) and return a true value. After returning 1301interested in (which can be none at all) and return a true value. After returning
1290true, it will be removed from the queue. 1302true, it will be removed from the queue.
1303
1304These methods may invoke callbacks (and therefore the handle might be
1305destroyed after it returns).
1291 1306
1292=cut 1307=cut
1293 1308
1294our %RH; 1309our %RH;
1295 1310
1851when this function returns. 1866when this function returns.
1852 1867
1853Due to bugs in OpenSSL, it might or might not be possible to do multiple 1868Due to bugs in OpenSSL, it might or might not be possible to do multiple
1854handshakes on the same stream. Best do not attempt to use the stream after 1869handshakes on the same stream. Best do not attempt to use the stream after
1855stopping TLS. 1870stopping TLS.
1871
1872This method may invoke callbacks (and therefore the handle might be
1873destroyed after it returns).
1856 1874
1857=cut 1875=cut
1858 1876
1859our %TLS_CACHE; #TODO not yet documented, should we? 1877our %TLS_CACHE; #TODO not yet documented, should we?
1860 1878
1929Shuts down the SSL connection - this makes a proper EOF handshake by 1947Shuts down the SSL connection - this makes a proper EOF handshake by
1930sending a close notify to the other side, but since OpenSSL doesn't 1948sending a close notify to the other side, but since OpenSSL doesn't
1931support non-blocking shut downs, it is not guaranteed that you can re-use 1949support non-blocking shut downs, it is not guaranteed that you can re-use
1932the stream afterwards. 1950the stream afterwards.
1933 1951
1952This method may invoke callbacks (and therefore the handle might be
1953destroyed after it returns).
1954
1934=cut 1955=cut
1935 1956
1936sub stoptls { 1957sub stoptls {
1937 my ($self) = @_; 1958 my ($self) = @_;
1938 1959

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines