Simple Network Programming
In networking, the terms “client” and “server” describe the party that is waiting for a new connection (the server) and the party that initiates a new connection (the client). Once the communications channel is set up, the client and server are peers that communicate with each other.
Server coding
Here is the set of calls and actions used when writing a server program:
Get a socket().
Construct an address–port pair that the server will listen on.
bind() the socket to the address.
Tell the socket to start listen()ing for new connections.
accept() new connections from clients.
Use read() and write() to receive and send data over the client connection.
close() the client connection’s socket.
int socket (int domain, ...
Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.