Click here to Skip to main content
6,306,412 members and growing! (22,740 online)
Email Password   helpLost your password?
Languages » C / C++ Language » General     Intermediate License: The Code Project Open License (CPOL)

Chat Client Server

By Boby Thomas P

An implementation of chat client and server with win32 sockets
C++, Windows, Win32, Visual Studio, Dev
Version:2 (See All)
Posted:6 May 2006
Updated:19 May 2007
Views:54,680
Bookmarked:38 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
44 votes for this article.
Popularity: 5.91 Rating: 3.59 out of 5
3 votes, 6.8%
1
3 votes, 6.8%
2
5 votes, 11.4%
3
6 votes, 13.6%
4
27 votes, 61.4%
5
Sample Image - chat_client_server.jpg - Click to enlarge image

Introduction

Recently I got myself introduced to socket programming. I read through many books and articles to get an insight into the subject. After learning a bit, I decided to share my knowledge with the world. For this purpose, I created a simple console based chat application. I hope this will be a good reference code for C++ socket 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 operations:

  • Listens for incoming calls from clients. Client running in any PC can connect to the server if IP address of the server is known.
  • Listens for messages from all the connected clients.
  • Broadcasts 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:

  • Sends messages to server as well as to all the connected clients.
  • Views the messages from all the clients and server.

Please download the PDF document to read the rest of the documentation. I have created a PDF because the article consists of 2-3 diagrams.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Boby Thomas P


Member
Check my homepage for more details - Click Here
Location: India India

Other popular C / C++ Language articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 19 of 19 (Total in Forum: 19) (Refresh)FirstPrevNext
Generalthnx Pinmemberharshmttl8:21 22 Jan '09  
GeneralRespected sir Pinmembershakher sumsher19:54 21 Jan '09  
GeneralC cde for chat server Pinmemberavinashk141:08 29 Aug '08  
GeneralI want to implement a chat server/client Pinmemberricha.cseit4:58 28 Feb '08  
GeneralRe: I want to implement a chat server/client Pinmemberchandreshpratapsrivastava5:18 23 Mar '09  
QuestionWant to develop a chat client PinmemberdipuThegr819:16 14 Nov '07  
Generalwchar_t PinmemberMan_cool20:42 9 Jul '07  
QuestionError? PinmemberXHungChung1:33 10 Nov '06  
AnswerRe: Error? PinmemberBoby Thomas P1:37 10 Nov '06  
Generalbehavior after cable break Win2k/ Winxp PinmemberBennet Yee21:13 12 May '06  
Generali have an idea Pinmembernoise@BUPT16:52 9 May '06  
GeneralRe: i have an idea PinmemberBoby Thomas P22:22 9 May '06  
Generalintegration of project Pinmemberdimas7510:54 7 May '06  
GeneralRe: integration of project Pinmembermysterious_caveman11:43 10 Jun '07  
Generalthanks Pinmemberraul_sfk1:48 7 May '06  
GeneralRe: thanks PinmemberBoby Thomas P9:56 7 May '06  
Generalinfo required PinmemberSunithaC1:43 7 May '06  
GeneralRe: info required PinmemberBoby Thomas P9:56 7 May '06  
GeneralRe: info required Pinmemberroninttk23:13 9 May '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 19 May 2007
Editor: Deeksha Shenoy
Copyright 2006 by Boby Thomas P
Everything else Copyright © CodeProject, 1999-2009
Web17 | Advertise on the Code Project