
WATTCP API Functions MVI-ADMNET ♦ 'C' Programmable
Developer's Guide 'C' Programmable Application Development Module with Ethernet
Page 80 of 122 ProSoft Technology, Inc.
February 20, 2013
6.2 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
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;
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 (page 96)
Commentaires sur ces manuels