 requires special priority. 6. Recv: This function is used to receive data. The return value of the function indicates the number of bytes received. The receive function is used in con- nection oriented implementation. #include <sys/types.h> #include <sys/socket.h> int recv (int SOCID, char *dataPtr, int length, int flag) i // "socID" is the descriptor of the socket from which the data is to be received. // "dataPtr" is a pointer to the data. // "length" is the buffer size for data received. // "flag" allows the caller to control details. 7. Sendto: This function is used to send data. The return value of the function indicates the number of bytes sent. The sendto function is used in a connec- tionless protocol implementation. #include <sys/types.h> #include <sys/socket.h> int sendto (int SOCID, const void *dataPtr, size_t dataLength, int flag, struct sockaddr *addrPtr, socklen_t addrLength) ; // "socID" is the id of the socket to which data is to be sent. // "dataPtr" is a pointer to the data. // "dataLength" shows the number of data octets. // "flag" allows the sender to control details. // "addrPtr" is a pointer to the address family. // "addrLength" is the size of address structure. 8. Recvfrom: This function is used to receive data. The return value of the func- tion indicates the number of bytes received. The recvfrom function is used in connectionless protocol implementation. Socket Communication #include <sys/types.h> #include <sys/socket.h> int recvfrom (int SOCID, void *dataPtr, int dataLength, int flag, struct sockaddr *addrPtr, int *addrLength) // "socID" is the id of the socket to which data is to be sent. // "dataPtr" is a pointer to the data. // "dataLength" is the buffer size for data received. // "flag" allows the caller to control details. // "addrPtr" is a pointer to the address family. // "addrLength" is the size of address structure. 9. Shutdown: This function is used to prevent sending or receiving data between sockets. #include <sys/types.h> #include <sys/socket.h> int shutdown (int SOCID, i