User`s guide
210
K
A
DAK
KwikNet TCP/IP Sockets
Returns If successful, the number of bytes of data stored at *buf is returned.
If the socket is closed by the sender, the value
0 is returned.
The structure at
*from contains the sender's address.
The storage at *fromlen is set to the actual size of the address.
On failure, the error status -1 is returned. The storage at *from and
*fromlen may be altered.
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, from or fromlen is invalid or the
buffer length len is declared to be less than 0 or
parameter *fromlen specifies a length that is less
than that required to accommodate a valid address.
EMSGSIZE The buffer length is too small to receive the message
atomically as required by the socket protocol.
EPROTOTYPE Request is invalid for sockets using the TCP protocol.
EWOULDBLOCK The socket is marked non-blocking or flags specifies
MSG_DONTWAIT and no data is available for reading.
ENOBUFS Memory needed to service the request is unavailable.
Restriction If there is no data available at the socket, the caller will be blocked waiting
for data to arrive unless the socket s is marked as non-blocking. In the
latter case, the caller will resume with a -1 error status and the error code
EWOULDBLOCK will be stored in the socket descriptor.
Restriction This procedure cannot be used to receive from a foreign host using the
TCP protocol. Use kn_recv() or kn_readv() instead.
See Also
kn_connect(), kn_readv(), kn_recv(), kn_socket()