package gapi-ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=b84b680528a5e050014103a8e7a60a5d43efd5fefc3f838310bd46769775ab48
md5=8ee26acf1f6c6f5e24c7b57fa070a0a2
doc/gapi-ocaml.netstring-local/Netchannels/class-pipe/index.html
Class Netchannels.pipe
Source
A pipe
has two internal buffers (realized by Netbuffer). The * output methods of the class write to the incoming buffer. When * new data are appended to the incoming buffer, the conversion function * conv
is called; the arguments are the incoming buffer and the outgoing * buffer. The conversion function must convert the data available in the * incoming buffer and append the result to the outgoing buffer. Finally, * the input methods of the class return the data found in the outgoing * buffer. * * The conversion function is called as follows: * conv incoming_buffer at_eof outgoing_buffer
* * The conversion function is allowed to do nothing if the incoming data * are not complete enough to be converted. It is also allowed to convert * only the beginning of the incoming buffer. * * If the outgoing buffer is empty, the input methods will raise * Buffer_underrun
. * * If close_out
is invoked, the end of the data stream will be recorded. * In this case, the conversion function is called with at_eof = true
, * and it is expected that this function converts the whole data found * in the incoming buffer. * * close_in
implies close_out
. * * The conversion function may raise exceptions. The exceptions will * fall through to the caller of the input methods. (The output methods * and close_in
, close_out
never fail because of such exceptions.) * * The default conversion function copies everything from the incoming * buffer to the outgoing buffer without modification.
inherit in_obj_channel
inherit out_obj_channel