WATTCP API Functions
MVI-ADMNET
♦
'C' Programmable
Ethernet Module
ProSoft Technology, Inc.
Page 51 of 90
December 13, 2006
ADMNET API Initialize Functions
The following topics detail the ADMNET API Initialize functions.
sock_init
Syntax:
void sock_init(void);
Parameters:
None
Description:
This function will read a stored TCP/IP configuration file and prepare a variable.
Return Value:
SK_SUCCESS
API has successfully initialized variables.
SK_PORT_NOT_ALLOW
API does not allow port number used.
SK_CANNOT_ALLOCATE_MEMOR
Y
API cannot allocate memory.
Example:
int numSK = 5;
int portNum = 5757;
int buffSize = 1000;
sock_init(); //initialize the socket interface
/* initialize each socket */ if(ADM_init_socket(numSK, portNum, buffSize,
"ReceiveSK") != SK_SUCCESS)
{
printf("\nFailed to open ADM API... exiting program\n");
ADM_release_sockets();
}
See Also:
sock_exit