Click here to Skip to main content
Click here to Skip to main content

Chat program

, 2 Dec 2002
Rate this:
Please Sign up or sign in to vote.
Simple chat program.

Sample Image - CSocket.jpg

Introduction

This very simple Chat program was written by using VC++ 6 under Windows 2000. CSocketCli program creates a client socket. CSocket program creates a server socket. If you run the client program, you must specify the address of the other computer in the IP Address editbox in "the server program".

If the client is running but the server isn't running, you will receive an error in the editbox down in the client program, but if you connect you will receive "Connected" message in the chat editbox in the client program.

When you run the server, you don't need to do any thing; just wait until some client program connects with the server. This program handles multiple clients and you can have private chat with friends.

Important note: If you run the Client and the Server in the same computer, please write in the client IP Address textbox the address 127.0.0.1, then press Connect button and you will be connected to the server.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

essam el-nagar
Software Developer (Senior)
Saudi Arabia Saudi Arabia
No Biography provided

Comments and Discussions

 
QuestionHello! [modified] PinmemberMember 103101355-Oct-13 3:06 
QuestionThank you for easy to follow code for Client and Server Sides... PinmemberDestiny7779-Feb-13 12:46 
The sample code works very well.
 
Thank you very much for posting it here.
 
---
 
The only improvement that could be helpful to others would be to make 1 program to allow either side of the connection to be the host or the client depending on which side initiated the connection.
 
---
 
All in all... very nice Server and Client Chat Programs.
 
Thanks again!
GeneralFirewall PinmemberAlexEvans21-Aug-10 23:22 
GeneralRe: Firewall PinmemberDestiny7779-Feb-13 12:41 
Questionhow are you Pinmembercen_jin_long22-Feb-10 12:41 
GeneralDownload = 0kb Pinmembercodeinelogic8-Jan-09 7:53 
GeneralRe: Download = 0kb Pinmembercodeinelogic8-Jan-09 8:02 
GeneralThank you. PinmemberMember 232736913-May-08 22:01 
Generalhome edition Pinmembervishal dhir24-Feb-07 20:16 
Questionhow to use it in campus PinmemberMember #368157930-Dec-06 0:05 
Questionhow to use it in campus PinmemberMember #368157930-Dec-06 0:04 
Questionwhat is socket programming Pinmembermahili19-Nov-06 21:28 
AnswerRe: what is socket programming Pinmemberkkyaw8823-Feb-07 10:45 
Generalvery usefull Pinmemberfserdary9-Aug-06 4:51 
Generalgood code PinmemberSujitmatrix2-May-06 4:21 
Generalexcellent sample code PinmemberGeorge98765432122-Mar-06 22:15 
GeneralCMD PinmemberPablo9836-Mar-06 11:37 
Generalgood job~~ Pinmemberrosenus12-Feb-06 4:58 
GeneralCheck the status Wether Connect to the internet or not PinmemberKutti Ra30-Sep-05 23:07 
Generalover the internet Pinmembermesut_pak12-Mar-05 5:44 
GeneralRe: over the internet PinmemberXiaozhou Ye6-Nov-05 21:10 
Questionhow to make one application work as a server and client simultaneously Pinmembersyaks29-Nov-04 7:19 
AnswerRe: how to make one application work as a server and client simultaneously PinmemberDestiny7779-Feb-13 12:54 
GeneralTransmit Image File PinmemberKeel15-Jan-04 20:15 
GeneralIPnr in list box PinmemberJockeP24-Aug-03 18:41 
GeneralBind Error PinmemberHazem Nasereddin7-Jan-03 2:54 
GeneralRe: Bind Error Pinsusskaizer25-Jun-03 5:45 
GeneralRe: Bind Error Pinmemberasimrehan131-Mar-13 8:47 
GeneralThanks... PinmemberMustafa Bayer4-Dec-02 8:45 
GeneralChat With US DI PinmemberDany Cantin26-Nov-02 16:56 
GeneralRe: Chat With US DI <<< Liggity Lame PinsussAnonymous4-Dec-02 6:57 
GeneralRe: Chat With US DI <<< Liggity Lame PinmemberDany Cantin5-Dec-02 3:30 
GeneralRe: Chat With US DI &lt;&lt;&lt; Liggity Lame PinsussAnonymous7-Jun-05 15:59 
GeneralThread Data Pinmemberkmaz5-Aug-02 11:52 
QuestionHow to make it work PinmemberGautam9826-Jun-02 20:31 
AnswerRe: How to make it work Pinmembertomdekok21-Jul-02 1:31 
AnswerRe: How to make it work PinmemberahkeR8-Mar-07 7:45 
GeneralClient Server Chat PinmemberMunty5410-May-02 19:37 
GeneralRe: Client Server Chat Pinsussbamaruckmani27-Sep-04 19:11 
GeneralThank you!!!! PinmemberAnonymous12-Mar-02 22:20 
GeneralRe: Thank you!!!! Pinmembertomdekok21-Jul-02 1:33 
GeneralYou have memory leaks PinmemberJacques11-Dec-01 16:00 
Generalhelp if you can Pinmemberconwaytowers16-Oct-01 5:18 
Generalquestion PinmemberJordan25-Sep-01 19:11 
GeneralThank you PinmemberUday T23-Jul-01 4:44 
Generalnumber of users on this application Pinmemberradical8-Jun-01 4:35 
GeneralExplaination PinmemberMaria Jothi29-May-01 19:46 
GeneralRe: Explaination Pinmemberzarzor3-Dec-02 15:07 
GeneralThank You very much PinmemberAmit Malik4-Apr-01 20:56 
QuestionHow to know when the ConnectionRequest occurs Pinmembermhs20-Mar-01 18:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 3 Dec 2002
Article Copyright 2001 by essam el-nagar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid