
SDK Programming Guide Version 1.511
ABLELink
R
Ethernet-Serial Server MAXI Series
udp_open()
Description:
Establish an UDP communication channel.
Include:
tcpapi.h, tcpdef.h
Usage:
int udp_open (int *
phandle
, short *
plocalPort
)
Phandle:
the pointer of the unique handle of the established
communication channel
Input Parameters:
plocalPort:
the pointer of local port number
Return Value:
SUCCESS
connect is successful
others
error, the definition of ERROR number please refer to the file
“
tcpdef.h
”
Example:
//Open an UDP channel with local port = 0x1234.
int handle
short localport=0x1234
if (udp_open((int *)&handle, (short *)&localport) == SUCCESS) {
// open ok , and return a unique handler
:
}
else {
// fatal error happened
:
}
Remarks:
This function is used by the client and severs to establish an UDP
communication channel.
udp_close()
Description:
Close an UDP communication channel.
Include:
tcpapi.h, tcpdef.h
Usage:
int udp_close (int
handle
)
Input Parameters:
handle
the unique handle of the established communication channel
Return Value:
SUCCESS disconnect is successful
others error, the definition of ERROR number please refer to the file
“
tcpdef.h
”
Copyright © 2004 Atop Technologies, Inc.
All rights reserved. Designed in Taiwan.