Sun Java System Web Server 7.0 Update 3 NSAPI Developer's Guide

netbuf_grab() Function

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.


int netbuf_grab(netbuf *buf, int sz);

Return Values

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


netbuf *buf is the buffer to read into.

int sz is the number of bytes to read.

See Also

netbuf_buf2sd() Function, netbuf_close() Function, netbuf_getbytes() Function, netbuf_getc() Function, netbuf_open() Function