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 184.108.40.206, 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 ...