Go to the previous, next section.
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);
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.
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
MSG_DONTROUTE
On success, returns the number of bytes sent. On error, the call returns
-1 and sets errno
to one of the following values:
EMSGSIZE
: the data is too big to be sent atomically.
ENOBUFS
: the system has not enought memory to allocate an
output buffer or the output queue for the network interface is full.
EBADF
, ENOTCONN
, ENOTSOCK
,
EWOULDBLOCK
, EINTR
or EFAULT
.
Go to the previous, next section.