8.2 recvfrom and sendto Functions
These two functions are similar to the standard read and write functions, but three additional arguments are required.
#include <sys/socket.h> |
ssize_t recvfrom(int sockfd , void *buff , size_t nbytes , int flags , struct sockaddr *from , socklen_t *addrlen ); |
ssize_t sendto(int sockfd , const void *buff , size_t nbytes , int flags , const struct sockaddr *to , socklen_t addrlen ); |
Both return: number of bytes read or written if OK, 1 on error |