Working with Sockets
Sockets are the de facto standard for communicating with other computers on both local area networks (LANs) and wide-area networks (WANs), such as the Internet. Two computers communicate to each other by using sockets that follow a general protocol where one computer is expecting to receive a connection, and the other makes the initial connection.
The computer expecting to receive a connection, the host or server, listens for incoming connections on a specific port. The computer has a unique IP address, such as 172.68.112.34, and thousands of port numbers available, making it possible for many programs to listen for connections, each using a different port.
The computer that makes the initial connection, the client, determines ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access