CSharp.Net-Informations.com
   Home      .Net Framework      VB.NET      C#                                                                      About


  How to C# Chat server programming

Network programming in windows is possible with Sockets .The Microsoft .NET framework provides two namespaces, System.Net and System.Net.Sockets for managed implementation of Internet protocols that applications can use to send or receive data over the Internet .

In the previous section C# Multi Threaded Socket Program we can see a C# Multi Threaded Server Socket Program communicate with more than one Client at the same time . But there the communication is occurred between Server to Client or Client to Server , there is no communication between Client to Client . C# Chat Server describes how to a Client can communicate with any number of Clients , currently connected to the Chat Server .

csharp-chat-server-1

The main idea behind the C# Chat Server is that each Client send messages to the Server and the Server broadcast the message to all Clients currently connected to the Chat Server . From the following picture you can see how a C# TCP Chat Server is handling communication between Client to Client .

csharp-chat-programming

The C# Chat Server program has two sections.

1. C# Chat Server

2. C# Chat Client

How to run Chat Server program ?

Create the C# Chat Server and C# Chat Client are two separate C# projects and compile and build the program. Open a DOS prompt and run the Server Program first and then run the Client program .

In the Client program, Enter a Chat name and click " 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 Clients at the same time and start chatting each other. If you plan to run more than one client, it is better to copy the .exe file in separate folders and run from the .exe file.

        
        
C# Tutorial




CSharp Communications Related Contents
*     How to send email from C#
*     How to send email with attachment from C#
*     How to send html email from C#
*     How to send cdo email from C#
*     How to find hostname of a computer
*     How to find IP Adress of a computer
*     How to read URL Content from webserver
*     How to C# Socket programming
*     C# Server Socket program
*     C# Client Socket program
*     C# Multi threaded socket programming
*     C# Multi threaded Server Socket programming
*     C# Multi threaded Client Socket programming
*     How to C# Chat Server
*     How to C# Chat Client


   Home      VB.NET      C#
CSharp Related Topics
*     An overview of Microsoft CSharp
*     C# Language Tutorial
*     C# Statements Tutorial
*     C# Collection Tutorial
*     C# String Tutorial
*     C# File Operations Tutorial
*     C# Excel Tutorial
*     C# Crystal Reports Tutorial
*     CSharp Communication Tutorial
*     C# Ado.Net Tutorial and Source Code
*     C# ADO.NET data Providers Tutorial
*     C# Dataset Tutorial
*     C# DataAdapater Tutorial
*     Csharp DataView Tutorial
*     Csharp Remoting Tutorial
*     C# XML Tutorial
*     C# DataGridView Tutorial
   Home      VB.NET      C#
More Source Code :   
Mail to :  feedback@net-informations.com
  |  Home   |  VB.NET   |  C#   |  SiteMap   |  Terms of Use   |  About   |
net-informations.com (C) 2010
All Rights Reserved. All other trademarks are property of their respective owners.