CS 241 Copyright ©: University of Illinois CS 241 Staff 17
Sending and Receiving Data
int sendto (int sockfd, char* buf,
size_t nbytes, int flags, struct
sockaddr* destaddr, int addrlen);
Send a datagram to another UDP socket.
Returns number of bytes written or -1.
int recvfrom (int sockfd, char* buf,
size_t nbytes, int flags, struct
sockaddr* srcaddr, int* addrlen);
Read a datagram from a UDP socket.
Returns number of bytes read or -1.