Network Socket API Reference¶
This section collects socket APIs used in the network programming labs.
The focus is TCP server/client development, non-blocking I/O, and event-loop integration.
APIs¶
| API | Purpose |
|---|---|
socket() |
Create a socket endpoint. |
bind() |
Bind a socket to a local address and port. |
listen() |
Put a TCP socket into passive listening mode. |
accept() |
Accept a new client connection. |
connect() |
Initiate a connection to a remote peer. |
recv() / send() |
Receive and send data on a connected socket. |
setsockopt() |
Configure socket options. |
inet_ntop() |
Convert binary IP addresses to printable strings. |