

If sendto() is used on a connection-mode ( SOCK_STREAM, SOCK_SEQPACKET) socket, the arguments dest_addr and addrlen are The argument sockfd is the file descriptor of the sending socket. Sendto(sockfd, buf, len, flags, NULL, 0) With a zero flags argument, send() is equivalent to write(2). The only differenceīetween send() and write(2) is the presence of flags. The send() call may be used only when the socket is in a connected state (so that the intended recipient is known). The system calls send(), sendto(), and sendmsg() are used to transmit a message to another socket.
