27-08-2012, 03:12 PM
Multithreading Chatting Application
multithreaded.doc (Size: 40.5 KB / Downloads: 58)
ABSTRACT
To design and implement a chat model which can perform many processes or tasks at same time with communication between client /server i.e., Multi-Threaded Server Client Chat Model.
In Client/Server applications the server normally listens to a specific port waiting for connection requests from a client. When a connection request arrives, the client and the server establish a dedicated connection to communicate. During the connection process, the client is assigned a local port number, and binds a socket to it. The client talks to the server by writing to the socket and gets information from the server by reading from it. Similarly, the server gets a new local port number to communicate with the client. The server also binds a socket to its local port and communicates with the client by reading from and writing to it. The server uses a specific port dedicated only to listening for connection requests from other clients. It cannot use this specific port for communication with the clients.
The client and the server must agree on a protocol. They must agree on the language of the information transferred back and forth through the socket. The java.net package in the Java development environment provides the class Socket which implements the client side and the class ServerSocket which implements the server side of the two-way link. And these are widely applicable in various mailing applications like yahoo,gmail applications.