Many of today’s systems act as servers to satisfy requests generated by clients. This is a form of distributed system, called client-server system.The main objective of this assignment is to implement a simple client-server system and chat server system by using multithreading in JAVA.Both the systems consist of two separate parts,client application and server application
DESCRIPTION:
One of the basic client-server services is the "echo service". The client program connects to the server over the network. After the connection is established, whatever the client sends to the server is echoed back by the server to the client. The Echo server can be either iterative or concurrent. An iterative server can serve only one client at a time. A concurrent server can handle multiple clients; each client will be handled by a separate thread.
SOCKET SERVER CREATION:
A socket is the one end-point of a two-way communication link between two programs running over the network. However one can run the two programs on the same computer. Such communicating programs constitutes a client/server application. The server implements a dedicated logic, called service. The clients connect to the server to get served, for example, to obtain some data or to ask for the computation of some data. Different client/server applications implement different kind of services.
A network connection is initiated by a client program when it creates a socket for the communication with the server. To create the socket in Java, the client calls the Socket constructor and passes the server address and the the specific server port number to it. At this stage the server must be started on the machine having the specified address and listening for connections on its specific port number. The server side socket associated with specific port is called server socket. When a connection request arrives on this socket from the client side, the client and the server establish a connection.