A tutorial on Chat Server and Chat Client in VB.net

By: Issac  

Multithreaded Socket Programming is the basic idea behind a TCP Chat Server communication. A Multithreaded Server Socket Program communicates with more than one Client at the same time. But there the communication is happening only between Server to Client or Client to Server, there is no communication between Client to Client. In a Multithreaded Chat Server, a Client can communicate with any number of Clients, currently connected on the Chat Server.

Each Client sends messages to the Server and the Server broadcasts the message to all Clients that are currently connected to the Chat Server. From the following figure you can see how a VB.NET TCP Chat Server is handling communication between Client to Client.


How to run Chat Server program?

After creating the Chat Server and Chat Client programs we have to run the Server program first and then run the Client program. In the Client program enter a Chat name and click the “Connect to Server “button. Then you can see the message in the Server program User Joined Chat Room. Similarly you can connect more than one Client at the same time and start chatting each other. It is better to Compile and Build the program and run from the .exe files.

Sample Code for Chat server in VB.net

Sample Code for Chat client in VB.net

Archived Comments

1. Dorothynob
View Tutorial          By: Dorothynob at 2017-03-06 19:24:47

2. [English]
Good morning ... the question arises in the following, when I start the server and

View Tutorial          By: Federico at 2012-06-01 13:55:13

3. thank you very much.
View Tutorial          By: hadi at 2011-10-20 14:14:39

4. Yes, as @ Mansi said it's really helpful.
I have done the same functionality in a j2me using

View Tutorial          By: Eko SW at 2011-06-22 23:38:22

5. I like men
View Tutorial          By: Ashley Wood at 2010-11-10 03:38:38


View Tutorial          By: mansi at 2009-12-23 00:35:43

Most Viewed Articles (in VB.net )

Latest Articles (in VB.net)

Comment on this tutorial