
Application Development Function Library - ADMNET API MVI-ADMNET ♦ 'C' Programmable
Developer's Guide 'C' Programmable Application Development Module with Ethernet
Page 74 of 122 ProSoft Technology, Inc.
February 20, 2013
ADM_receive_buffered_UDP_sk
Syntax
int ADM_receive_buffered_UDP_sk(char *skName, char *holdRecPtr, int
*readLen, char *fromIP, int nBlock);
Name of the socket that has been initialized and used to receive messages
Pointer to a buffer to hold data that will be received by the API
Length of data received by the API
Character array to hold client IP address
Function will block on receive if nBlock > 0. If nBlock is 0, the function will
return
Description
This function is used to receive messages when ADM_init_UDP_buffer is used.
Received messages will be placed in the buffer pointed to by holdRecPtr. The
parameter readLen will be updated with the length of the received message. The
client’s IP address will be placed in fromIP.
Message received if nBlock is non-zero. If nBlock is 0 then this
denotes a successful receive check which will result in a received
message if a message was available..
Socket could not be found.
Example
char sockName1[] = "ReceiveSocket";
char data[1024];
int length;
char fromIP[64];
unsigned long recvVal[10];
length = MAX_MESSAGE;
err = ADM_receive_buffered_UDP_sk(sockName1, data, &length, fromIP, 1);
if(length > 0)
{
recvVal[index++] = *(unsigned long *)data;
}
if(err < 0)
{
printf("got error\n");
}
Comentários a estes Manuais