![]() ![]() Once the service agent answers the phone, two-way communication between the client and the server can begin.įigure provides a view of the client/server connection. This is analogous to the client program creating a socket and making a connection to a server. A human client picks up the phone and dials the number of a particular service. The client can close the connection when the service is completed. Once a connection has been established, the client creates input and output streams to the socket and begins exchanging messages with the server. The client has to know the server’s URL and the port at which the service exists. A socket, combined with input and output streams, is something like a two-way phone connection.įrom the client’s side, the protocol goes as follows: The client creates a socket and attempts to make a connection to the server. When it rings, the server picks it up and begins communicating with the client. The “server” waits for the phone to ring. To help clarify this protocol, think of some service performed by a human using a telephone connection. Either the client or the server can close the connection, but it’s usually done by the client. Once the connection is established, the server creates input and output streams to the socket and begins sending messages to and receiving messages from the client. For example, the standard port for an HTTP (Web) server is 80. It is usually represented as a simple integer value. A port is a particular address or entry point on the host computer, which typically has hundreds of potential ports. The protocol simply prescribes rules and behavior that both the server and client must follow in order to establish two-way communication.Īccording to this protocol, a server program creates a socket at a certain port and waits until a client requests a connection. A socket supports two-way communication between a client and a server, using a well-established protocol. In this section, we develop a simple client/server framework based on a socket connection between the client and the server.Ī socket is a simple communication channel through which two programs communicate over a network. According to this model, a task is viewed as a service that can be requested by clients and handled by servers. \)Īs we said earlier, many networking applications are based on the client/ server model. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |