
MVI-ADMNET ♦ 'C' Programmable Application Development Function Library - ADMNET API
'C' Programmable Application Development Module with Ethernet Developer's Guide
ProSoft Technology, Inc. Page 65 of 122
February 20, 2013
5.2 ADMNET API Initialize Functions
The following topics describe the ADMNET API Initialize functions.
ADM_init_socket
Syntax
int ADM_init_socket(int numSK, int portNum, int buffSize, char *name);
Parameters
Variable indicating how many sockets to use.
The size of the buffer available in each socket.
Description
ADM_init_socket acquires access to the ADMNET API and dynamically
generates a set of sockets according to numSK and assigns portNum, buffSize,
then names each socket that the application will use in subsequent functions.
This function must be called before any of the other API functions can be used.
IMPORTANT After the API has been opened, ADM_Release_Sockets should always be called
before exiting the application.
Return Value
API has successfully initialized variables.
API does not allow port number used.
SK_CANNOT_ALLOCATE_MEMORY
API cannot allocate memory.
Example
int numSK = 5;
int portNum = 5757;
int buffSize = 1000;
if(ADM_init_socket(numSK, portNum, buffSize, "ReceiveSK") != SK_SUCCESS)
{
printf("\nFailed to open ADM API... exiting program\n");
ADM_release_sockets();
}
See Also
ADM_release_sockets (page 68)
Kommentare zu diesen Handbüchern