int bind( SOCKET s, const struct sockaddr FAR *name, int namelen ); Parameters s [in] Descriptor identifying an unbound socket. name [in] Address to assign to the socket from the SOCKADDR structure. namelen [in] Length of the value in the name parameter. The recvfrom function receives a datagram and stores the source address.int recvfrom( SOCKET s, char FAR* buf, int len, int flags, struct sockaddr FAR *from, int FAR *fromlen ); Parameters s [in] Descriptor identifying a bound socket. buf [out] Buffer for the incoming data. len [in] Length of buf. flags [in] Indicator specifying the way in which the call is made. from [out] Optional pointer to a buffer that will hold the source address upon return. fromlen [in, out] Optional pointer to the size of the from buffer. int sendto( SOCKET s, const char FAR *buf, int len, int flags, const struct sockaddr FAR *to, int tolen ); Parameters s [in] Descriptor identifying a (possibly connected) socket. buf [in] Buffer containing the data to be transmitted. len [in] Length of the data in buf. flags [in] Indicator specifying the way in which the call is made. to [in] Optional pointer to the address of the target socket. tolen [in] Size of the address in to.
SOCKET s,
const struct sockaddr FAR *name,
int namelen
);
Parameters
s
[in] Descriptor identifying an unbound socket.
name
[in] Address to assign to the socket from the SOCKADDR structure.
namelen
[in] Length of the value in the name parameter. The recvfrom function receives a datagram and stores the source address.int recvfrom(
SOCKET s,
char FAR* buf,
int len,
int flags,
struct sockaddr FAR *from,
int FAR *fromlen
);
Parameters
s
[in] Descriptor identifying a bound socket.
buf
[out] Buffer for the incoming data.
len
[in] Length of buf.
flags
[in] Indicator specifying the way in which the call is made.
from
[out] Optional pointer to a buffer that will hold the source address upon return.
fromlen
[in, out] Optional pointer to the size of the from buffer. int sendto(
SOCKET s,
const char FAR *buf,
int len,
int flags,
const struct sockaddr FAR *to,
int tolen
);
Parameters
s
[in] Descriptor identifying a (possibly connected) socket.
buf
[in] Buffer containing the data to be transmitted.
len
[in] Length of the data in buf.
flags
[in] Indicator specifying the way in which the call is made.
to
[in] Optional pointer to the address of the target socket.
tolen
[in] Size of the address in to.