Elementary Socket Calls (contd)
int recv (int sockfd, char *buff, int nbytes, int flags);
- receive a message from the other end of connection (TCP)
-
int recvfrom (int sockfd, char *buff, int nbytes, int flags, struct sockaddr *from, int addrlen);
- receive message from any sender (UDP)
-
int read (int fdesc, char *buff, int nbytes);
- read (receive) the message (TCP)
-
int write (int sockfd, char *buff, int nbytes);
- write (send) the message (TCP)
-
htons(), htonl(), ntohs(), ntohl()
- translate between host and network byte orderings
-