User`s guide
214
K
A
DAK
KwikNet TCP/IP Sockets
kn_send kn_send
Purpose Send Data to a Connected Socket
Used by
n Task o ISP o Timer Procedure o Restart Procedure o Exit Procedure
Setup Prototype is in file KN_SOCK.H.
#include "KN_SOCK.H"
int kn_send(int s, void *buf, int len, int flags);
Description S is a socket descriptor identifying the connected socket to which data is to
be sent.
Buf is a pointer to the buffer of data to be sent.
Len is the buffer size, measured in bytes.
Flags is a control variable used to modify the send process. Flags is 0 or
the logical OR of any of the following values.
MSG_OOB Allow sending of out-of-band data.
MSG_DONTWAIT Send message in non-blocking fashion.
Returns If successful, the number of bytes of data sent from *buf is returned.
On failure, the error status -1 is returned.
The error indicator for socket s is set to define the reason for failure. Use
kn_errno() to retrieve the error code.
EBADF The socket descriptor s is invalid.
EINVAL Parameter buf or len is invalid or
the buffer length len is declared to be less than 0 or
is invalid for the socket's protocol.
ENOTCONN The socket is not connected.
EHOSTUNREACH A destination is required but is not available.
EMSGSIZE The message is larger than the maximum which can
be sent atomically as required by the socket protocol.
ESHUTDOWN The socket has been marked to shut down writing or
the socket is in the process of being closed.
EWOULDBLOCK The socket is marked non-blocking or flags specifies
MSG_DONTWAIT but there is a need to block the caller
to complete the operation.
ENOBUFS Memory is not available to complete the request.
...more