Admnet api initialize functions – ProSoft Technology MVI69-ADMNET User Manual
Page 80
![background image](https://www.manualsdir.com/files/866089/content/doc080.png)
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
SK_SUCCESS
API has successfully initialized variables.
SK_PORT_NOT_ALLOW
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)