Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide

netbuf_grab

The netbuf_grab function reads sz number of bytes from the network buffer’s (buf) socket into the network buffer. If the buffer is not large enough, it is resized. The data can be retrieved from buf->inbuf on success.

This function is used by the function netbuf_buf2sd.

Syntax

int netbuf_grab(netbuf *buf, int sz);

Returns

The number of bytes actually read (between 1 and sz) if the operation was successful, or the constant IO_EOF or IO_ERROR for end of file or error.

Parameters

netbuf *buf is the buffer to read into.

int sz is the number of bytes to read.

See Also

netbuf_buf2sd, netbuf_close, netbuf_grab, netbuf_open