Next Previous Up Top Contents Index

10.4.5 The <BUFFERED-SOCKET> class

<buffered-socket>

Class

Superclasses: <socket>, <double-buffered-stream>
Socket streams whose elements are bytes or characters. These inherit buffering protocols and the implications of read, write, read-element, write-element, force-output and suchlike methods from <double-buffered-stream>.
Keywords:
force-output-before-read?:

An instance of <boolean>. Defaults value: #t. The methods which implement the stream reading protocols (read, read-line, read-element and so on) for instances of <socket> call force-output by default before blocking. This is to ensure that any pending output has been sent to the peer before the socket blocks waiting to read data sent by the peer. This corresponds to the expected, usual behavior of single-threaded client sockets and avoids deadlock in usual cases. Multi-threaded applications, particularly applications where one thread is reading and another thread is writing to the same socket, may wish to inhibit the default force-output. If the socket is created with force-output-before-read?: as #f, force-output will not be called before the read functions block.

System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index