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.19 by root, Sat May 24 05:57:11 2008 UTC vs.
Revision 1.20 by elmex, Sat May 24 08:16:50 2008 UTC

83waiting for data. 83waiting for data.
84 84
85=item on_error => $cb->($self) 85=item on_error => $cb->($self)
86 86
87This is the fatal error callback, that is called when, well, a fatal error 87This is the fatal error callback, that is called when, well, a fatal error
88ocurs, such as not being able to resolve the hostname, failure to connect 88occurs, such as not being able to resolve the hostname, failure to connect
89or a read error. 89or a read error.
90 90
91The object will not be in a usable state when this callback has been 91The object will not be in a usable state when this callback has been
92called. 92called.
93 93
102 102
103This sets the default read callback, which is called when data arrives 103This sets the default read callback, which is called when data arrives
104and no read request is in the queue. 104and no read request is in the queue.
105 105
106To access (and remove data from) the read buffer, use the C<< ->rbuf >> 106To access (and remove data from) the read buffer, use the C<< ->rbuf >>
107method or acces sthe C<$self->{rbuf}> member directly. 107method or access the C<$self->{rbuf}> member directly.
108 108
109When an EOF condition is detected then AnyEvent::Handle will first try to 109When an EOF condition is detected then AnyEvent::Handle will first try to
110feed all the remaining data to the queued callbacks and C<on_read> before 110feed all the remaining data to the queued callbacks and C<on_read> before
111calling the C<on_eof> callback. If no progress can be made, then a fatal 111calling the C<on_eof> callback. If no progress can be made, then a fatal
112error will be raised (with C<$!> set to C<EPIPE>). 112error will be raised (with C<$!> set to C<EPIPE>).
250for reading. 250for reading.
251 251
252The write queue is very simple: you can add data to its end, and 252The write queue is very simple: you can add data to its end, and
253AnyEvent::Handle will automatically try to get rid of it for you. 253AnyEvent::Handle will automatically try to get rid of it for you.
254 254
255When data could be writtena nd the write buffer is shorter then the low 255When data could be written and the write buffer is shorter then the low
256water mark, the C<on_drain> callback will be invoked. 256water mark, the C<on_drain> callback will be invoked.
257 257
258=over 4 258=over 4
259 259
260=item $handle->on_drain ($cb) 260=item $handle->on_drain ($cb)
488Append the given callback to the end of the queue (C<push_read>) or 488Append the given callback to the end of the queue (C<push_read>) or
489prepend it (C<unshift_read>). 489prepend it (C<unshift_read>).
490 490
491The callback is called each time some additional read data arrives. 491The callback is called each time some additional read data arrives.
492 492
493It must check wether enough data is in the read buffer already. 493It must check whether enough data is in the read buffer already.
494 494
495If not enough data is available, it must return the empty list or a false 495If not enough data is available, it must return the empty list or a false
496value, in which case it will be called repeatedly until enough data is 496value, in which case it will be called repeatedly until enough data is
497available (or an error condition is detected). 497available (or an error condition is detected).
498 498

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines