|
sendmsg |
Top Previous Next |
|
The sendmsg function sends a message through a connection-oriented or connection-less socket. If the socket is connection-less, the message is send to the address specified by msghdr. If the socket is connection-oriented, the destination address in msghdr is ignored.
Syntax
Parameters socket The descriptor that identifies a connected socket.
msg Points to a msghdr structure, containing both the destination address and the buffers for the outgoing message. The length and format of the address depend on the address family of the socket. The msg_flags member is ignored.
flags Specifies the type of message transmission. Values of this argument are formed by logically OR'ing zero or more of the following flags:
Return value Upon successful completion, sendmsg returns the number of bytes sent. Otherwise, -1 is returned and errno set to indicate the error. |