

(Note that the client’s port doesn’t change. That way, the original listening port is immediately available to receive new connections from other clients, thus allowing a server to provide the same service to multiple clients at the same time. a temporary port).įrom that point onward, the communication between the client and server takes place using the new server port. Such a port is called an ephemeral port (i.e. Now, instead of the server’s listening port being monopolized by that client for the duration of the connection, the server actually allocates a new port for the server to use for the duration of that connection. A server, upon receiving a connection from a client, will accept the connection.For example, web browsers are configured to connect to port 80 of the website that you want to view. A client that wants to use a service needs to connect to the listening port for the service on the server.Caveats: Two programs cannot listen on the same port at the same time.A port is a number, generally in the range 1 to 65535.For example, a web server generally listens on port 80. A server provides a service by listening on a port for incoming connections.For example, a web browser is a client that uses the services of a web server. A client is a machine or program that uses services.For example, a web server provides the service of “serving webpages”. A server is a machine or program that provides services.
