178
K
DAK
KwikNet Low Level Services
kn_udpsend kn_udpsend
Purpose Send a UDP Datagram on a Network
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_udpsend(unsigned long udpchannel,
struct in_addr *fhostp, int fport,
char *bufp, int length);
Description Udpchannel is a UDP handle acquired with a previous call to
kn_udpopen().
Fhostp is a pointer to a structure containing the IPv4 address, in net
endian form, of the foreign host to whom you wish to send a UDP
datagram. 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) */
};
Fport
is the foreign port number to which you are sending the UDP
datagram.
Bufp is a pointer to a character buffer containing the data bytes which you
wish to send in the UDP datagram.
Length is the number of bytes in the character buffer referenced by bufp.
Returns If successful, a value of 0 is returned.
On failure, the error status
-1 is returned.
The most likely reasons for failure are:
Invalid UDP channel handle
Destination is not accessible via any local network interface
No memory is available to construct and send the datagram
Length exceeds the maximum supported UDP/IP data segment size.
Example See example in the description of kn_udpopen().
See Also
kn_udpopen()
Comments to this Manuals