Click here to Skip to main content
6,596,602 members and growing! (22,494 online)
Email Password   helpLost your password?
General Programming » Internet / Network » Internet & Network     Intermediate

A Simple Chat Application Using .NET Remoting

By Anil Kumar

This application demonstrates .NET remoting in LAN.
C#.NET 1.0, Win2K, Dev
Posted:13 Nov 2001
Views:193,573
Bookmarked:54 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
44 votes for this article.
Popularity: 4.00 Rating: 2.43 out of 5
23 votes, 59.0%
1
2 votes, 5.1%
2
2 votes, 5.1%
3
6 votes, 15.4%
4
6 votes, 15.4%
5
Sample Image - DotNETChatApplication.gif

Introduction

The application is a simple chat tool. Anyone who connects to the chat server receives all chat communication between the connected users. The application is deliberately kept simple to clarify .NET remoting. This application also demonstrates event and delegate usage in an application that uses .NET remoting.

Description

Most of you will have noticed that there are wizards to develop ASP.NET web services in Visual Studio .NET. However, if you want to develop a Client/Server application that runs over a local area network, there are no wizards available. This application shows how to do .NET remoting in a Local Area Network. This application acts much like a DCOM server and client application. This Visual Studio .NET solution contains three modules.

  1. ChatCoordinator: The server implementation.
  2. ChatClient: The client implementation.
  3. ChatServer: The runtime host for Chat coordinator.

This uses HTTP protocol schema and sends the messages through an HTTP channel. The remoting configuration is specified in the ChatClient.exe.config file and the ChatServer.exe.config file.

How to Build the Application

  • Step-1: Extract the file DotNETChatApplication_demo.zip.
  • Step-2: Open the file ChatApplication.sln in Visual studio .NET.
  • Step-3: Build the Solution.

How to Run the Application

  • Step-1: Locate the folder Output under the project folder.
  • Step-2: Run the server application ChatServer.exe.
  • Step-3: Run the chat client ChatClient.exe.

This application runs on a single computer or across a network. If you want to run this application over a network, you must replace "localhost" in the client configuration with the name of the remote computer. Modify the following line in Client.exe.config:

<wellknown type="ChatCoordinator.ChatCenter, ChatCoordinator" 
    url="http://localhost:100/ChatServer" />

...to:

<wellknown type="ChatCoordinator.ChatCenter, ChatCoordinator" 
    url="http://your machine name:100/ChatServer" />

Also make sure that the ChatServer.exe is running before you run ChatClient.exe.

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

About the Author

Anil Kumar


Member

Location: United States United States

Other popular Internet / Network articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 65 (Total in Forum: 65) (Refresh)FirstPrevNext
GeneralMFC app stopped working.. PinmemberMember 443453621:22 13 Mar '09  
GeneralNot Compiling Pinmembermdubey823:21 2 Jun '08  
QuestionCannot find config files in the zip PinmemberMember 67099210:20 11 Dec '07  
GeneralDotNETChatApplication Pinmembersephr21:13 7 Nov '07  
GeneralRequested service not found exception in dotnet remoting PinmemberLavans0:50 11 Dec '06  
GeneralRe: Requested service not found exception in dotnet remoting Pinmemberghumman6321:04 12 Apr '07  
Questionmissing chatserver.exe.config Pinmembermsushmitha21:50 30 Nov '06  
Questionmissing chatserver.exe.config Pinmemberpalikila_indu21:38 30 Nov '06  
Questionerror help PinmemberMythiliPattabiraman23:58 7 Sep '06  
GeneralError of cross-thread.... Pinmemberpannujagwinder9:10 23 Aug '06  
AnswerRe: Error of cross-thread.... Pinmember@Jim13:43 15 Aug '07  
GeneralNot working on LAN [modified] Pinmemberassssssssssurya1:19 26 Jul '06  
GeneralCannot run over the LAN PinmemberThe_Fixer_8310:08 27 Mar '06  
GeneralRe: Cannot run over the LAN Pinmember@Jim14:20 15 Aug '07  
QuestionSNMP Application Pinmemberpriyeshtinku20:37 23 Mar '06  
QuestionUnable to update richTextMessage Pinmemberdevchandc7:53 16 Nov '05  
Generalerror Pinmembersoul_reaver10:02 22 Sep '05  
GeneralConnection refused Pinmemberbellerofonte0:49 2 Sep '04  
General'System.IO.FileNotFoundException' PinmemberVirgil Reboton4:49 15 Jun '04  
GeneralRe: 'System.IO.FileNotFoundException' Pinmemberervisdee22:13 21 Apr '08  
GeneralRe: 'System.IO.FileNotFoundException' PinmemberMember 41608319:09 2 Oct '08  
GeneralMessage to one specific client PinmemberHolgerK8:31 30 Mar '04  
GeneralDocumentating the project!! Pinmembervishwa_3111:56 25 Mar '04  
Generalstore Chat in Sql database Pinmemberinvytiffany7:27 16 Mar '04  
GeneralRe: store Chat in Sql database PinmemberH_LionHeart15:14 30 Sep '04  

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

PermaLink | Privacy | Terms of Use
Last Updated: 13 Nov 2001
Editor: Genevieve Sovereign
Copyright 2001 by Anil Kumar
Everything else Copyright © CodeProject, 1999-2009
Web19 | Advertise on the Code Project