
MVI-ADMNET ♦ 'C' Programmable Application Development Function Library - ADMNET API
'C' Programmable Application Development Module with Ethernet Developer's Guide
ProSoft Technology, Inc. Page 73 of 122
February 20, 2013
ADM_receive_sk
Syntax
int ADM_receive_sk(char *skName, char *holdRecPtr, int *readLen, char *fromIP);
Parameters
Name of the socket that has been initialized and used to receive data.
Pointer to a buffer to hold data that will be received by the API.
Length of data received by the API.
Pointer to character array which in turn return with client IP.
Description
This function receives socket after ADM_open_sk is used. skName must be a
valid name that has been initialized with ADM_init_socket.
Return Value
Socket is successfully sent.
Socket could not be found.
Socket is in the process of sending.
Example
char sockName1[ ] = "SendSocket";
char holdingReg[100];
int result;
while ((result=ADM_receive_sk(sockName1, holdingReg, &readLen, fromIP)) ==
SK_PROCESS_SOCKET);
if(result == SK_SUCCESS){
printf("Received data!\n");
printf("Length == %d\n", readLen);
for (i=0; i<readLen; i++)
{
printf("%c", *(holdingReg+i));
}
printf("\n");
} else {
printf("Received no data Error: %d\n",result);
}
Comentarios a estos manuales