___________________________________________________________________________
Boby Thomas (bobypt@gmail.com) Page 1 07.05.2006
___________________________________________________________________________
Chat Client Server
Recently I got introduced myself with socket programming. I read through many books and
articles to get more insight into the subject. I thought why not share it with the world what I
have learned. For this purpose I created a simple console based chat application. I hope this
will be a good reference code for you C++ programming. I am going to introduce the
following concepts to you here.
• Sockets.
• Multi threading.
What is Chat Client Server?
The demo project given along with this article consists of two console-based applications.
Chat Server
Chat server is an application, which does the following things.
• Listens for incoming calls from clients. Client running in any pc can connect to
the server if IP address of the pc where server is running is known.
• Listens for messages from all the connected clients.
• Broadcast the message from clients to all the clients connected to the server.
• You can also type-in messages in the server, which will be broadcasted to all
the clients.
Chat Client
Chat client does the following things.
• Send messages to server as well as all the connected the clients.
• View the messages from all the clients and server.
Server Design
Following diagram explains the operations performed by the server application.