MVI-ADMNET
♦
'C' Programmable
WATTCP API Functions
Ethernet Module
Page 76 of 90
ProSoft Technology, Inc.
December 13, 2006
ADMNET API Receive Socket Functions
This section describes the ADMNET API Receive Socket functions.
sock_read
Syntax:
int sock_read( sock_type *skType, byte *data, int len);
Parameters:
skType
Socket that will be used to receive data.
data
Pointer to a buffer that contains data that is received.
len
Length of the data specified to receive.
Description:
This function reads data from the socket being passed to the function. The
function will wait until the all the data is read.
Return Value:
Number of Bytes that are read to the socket or -1 if an error occurs.
Example:
sock_type *socket;
char theBuffer [512];
int len, bytes_receive;
. . .
bytes_receive = sock_read(socket, (byte*)theBuffer, len);
See Also:
sock_fastread