<< Previous | Index | Next >>

sock_preread


int sock_preread( tcp_Socket *s, byte *dp, int len );

Description

This function reads up to len bytes from the socket into the buffer dp. The bytes are not removed from the socket's buffer. This function is only valid with TCP sockets.

Parameters

s

Pointer to a socket structure.

dp

Buffer to preread into.

len

Maximum number of bytes to preread.

Return value

 0: No data waiting.
-1: Error.
>0: Number of preread bytes.

Library

TCP.LIB (Prior to DC 7.05, this was DCRTCP.LIB)

See also

sock_fastread, sock_fastwrite, sock_read, sock_write


TCP/IP Manual
Vol 1
<<Previous | Index | Next>> rabbit.com