AMX DESIGN XPRESS V 1.5 - PROGRAMMER GUIDE User's Guide Page 186

  • Download
  • Add to my manuals
  • Print
  • Page
    / 316
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 185
172
K
A
DAK
KwikNet Low Level Services
kn_udpbind kn_udpbind
Purpose Bind a Local IP Address and Port to a UDP Channel
Used by
n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure
Setup Prototype is in file KN_API.H.
#include "KN_LIB.H"
int kn_udpbind(unsigned long udphandle,
struct in_addr *lhostp, int lport);
Description Udphandle is a UDP handle acquired with a previous call to
kn_udpopen().
Lhostp is a pointer to a structure containing the IPv4 address, in net
endian form, of the local network interface which you wish to bind to
the UDP channel. All UDP datagrams sent on the UDP channel will be
transmitted on that network interface.
The BSD structure in_addr is defined in Treck header file TRSOCKET.H
as follows:
struct in_addr {
u_long s_addr; /* IP address (net endian) */
};
Lport
is the local port number, in host endian form, to be used for
communication. Set lport to 0 if you will accept UDP datagrams
destined to any port on the network interface to which the UDP channel
is bound.
Returns If successful, a value of 0 is returned.
If a local network with the specified IPv4 address does not exist, the error
status -1 is returned.
Restriction You cannot bind a UDP channel to a specific local network interface
unless the UDP channel was opened with a local IP address and port of 0.
A UDP channel can only be bound once. To bind to an alternate IP
address or port, you must close the UDP channel, open another one and
bind it as required.
See Also kn_udpclose(), kn_udpopen()
Page view 185
1 ... 185 186 187 ... 316

Comments to this Manuals

No comments