Go to the previous, next section.

send, sendmsg and sendto

SYNOPSIS

int send(int s, const void *buf, int len, unsigned int flags);

int sendto(int s, const void *buf, int len, unsigned int flags, const struct sockaddr *to, int tolen);

int sendmsg(int s, const struct msghdr *msg , unsigned int flags);

PARAMETERS

s: [in] the socket on which to send.

buf: [in] points to the buffer that contains the data to send.

len: [in] the lenght of buf.

flags: [in] some flags (see description).

to: [in] points to the peer address where to send the data.

tolen: [in] the length of to.

msg: [in] the message to send.

DESCRIPTION

sendmsg is not yet implemented.

send is used to send data on a connection-oriented socket. sendto and sendmsg are used on connection-less or connection-oriented sockets. Unless the socket is non-blocking the call will block until the data is send.

The flags may be one or more or'ed values from the following:

MSG_OOB
send the data out-of-band.

MSG_DONTROUTE
bypass the routing facilities of the system.

RETURN VALUE

On success, returns the number of bytes sent. On error, the call returns -1 and sets errno to one of the following values:

Go to the previous, next section.