
WATTCP API Functions MVI-ADMNET ♦ 'C' Programmable
Developer's Guide 'C' Programmable Application Development Module with Ethernet
Page 84 of 122 ProSoft Technology, Inc.
February 20, 2013
udp_open
Syntax
int udp_open( udp_Socket *sk, word lPort, longword ina, word port,
dataHandler_t datahandler );
Parameters
Pointer to the socket that has been initialized.
Data Handler. Not used in this version. Use NULL for this parameter.
Description
This function opens a UDP socket connection to a host machine using
parameters passed to it. IPort is an option parameter. Most of the time, IPort can
be set to 0. The API will find an available port number for the socket. ina is a host
IP address passed as a longword. Function resolve can be use to convert an IP
address into a longword-formatted variable.
Return Value
Connection cannot be made
Example
udp_Socket *socket;
. . .
if(udp_open(socket, 0, resolve("192.168.0.1"), 5656, NULL))
{
printf("Open Successfully\n");
}
See Also
resolve (page 86)
Komentarze do niniejszej Instrukcji