 |
TCP Sockets API
|
KADAK's KwikNet TCP/IP Stack
includes a full featured sockets API with minor adaptations to
support re-entrant user applications. The static variable
errno is replaced by function
kn_errno() which returns the result of
the most recent operation on a particular socket.
The KwikNet API uses function names which mimic standard BSD names.
The following lists summarize all of the KwikNet sockets services which
are accessible to the user.
 |
Socket Control Services
|
 |
kn_socket |
 |
Create a socket (an endpoint for communication) |
| kn_bind |
Bind a local address to a socket |
| kn_connect |
Connect a socket to a specific address |
| kn_listen |
Request a socket to listen for connection requests |
| kn_accept |
Accept a connection request and establish a new socket |
| kn_close |
close a socket |
 |
Receive Services
|
 |
kn_recv |
 |
Receive data from a connected socket |
| kn_recvfrom |
Receive data from a socket (gets sender's address) |
| kn_readv |
Receive scattered data from a socket (gets sender's address) |
 |
Send Services
|
 |
kn_send |
 |
Send data to a socket |
| kn_sendto |
Send data to a socket (with destination address) |
| kn_writev |
Send scattered data to a socket (with destination address) |
 |
Miscellaneous Services
|
 |
kn_errno |
 |
Fetch most recent status result (error code) for a socket |
| kn_select |
Select sockets ready to receive or send data |
| kn_shutdown |
Shutdown all or part of a full duplex socket connection |
| kn_getpeername |
Gets the address of the remote end of a connected socket |
| kn_getsockname |
Get the local address of a socket |
| kn_getsockopt |
Get a particular socket option |
| kn_setsockopt |
Set a particular socket option |
|