The client object contains an abstraction over the network connection (i.e. netpipe) which handles all network I/O. The data is accumulated into a FIFO buffer in the netpipe, which is dequeued to a special buffer only when it can be completely written out. This precaution is necessary since short reads and writes can occur in a non-blocking system, i.e. each I/O can be interrupted by another operation.
This part of the design is taken directly from the previous project, the TCP Proxy design.