Application Development Function Library: ADMNET API
MVI-ADMNET
♦
'C' Programmable
Ethernet Module
ProSoft Technology, Inc.
Page 43 of 90
December 13, 2006
ADMNET API Send Socket Functions
This section describes the ADMNET API Send Socket functions.
ADM_send_socket
Syntax:
int ADM_send_socket(char *skName, char *holdSendPtr, int *sendLen, char
*ServerIPAddress, int protocol);
Parameters:
skName
Name of the socket that has been initialized and used
to send data.
holdSendPtr
Pointer to a string of data that will be sent to the
ServerIPAddress
sendLen
Number of data specified to send.
ServerIPAddress
IP address that will be used to send data to.
protocol
Specified protocol to send over Ethernet (USE_TCP or
USE_UDP).
Description:
To simplify a program, this function opens connection and sends message.
skName
must be a valid name that has been initialized with ADM_init_socket.
Return Value:
SK_SUCCESS Socket
is
successfully sent.
SK_NOT_FOUND
Socket could not be found.
SK_PROCESS_SOCKET
Socket is in the process of sending.
Example:
int sendLen = 10;
int se;
se = ADM_send_socket("sendSK", "1234567890", &sendLen, "192.168.0.148", USE_UDP);
if(se == SK_SUCCESS)
{
printf("send Success\n");
}
See Also:
ADM_receive_socket