Click here to Skip to main content
15,886,137 members
Articles / Desktop Programming / Windows Forms

Chat Application with Windows Services, .NET Remoting in C#

Rate me:
Please Sign up or sign in to vote.
4.71/5 (5 votes)
13 Aug 2009CPOL4 min read 59.2K   5.7K   40  
A chat application with Windows Services, .NET Remoting in C#.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using RemoteHello;
using System.Runtime.Remoting.Channels.Http;

namespace ChatServer
{
    public partial class ChatService : ServiceBase
    {
        public ChatService()
        {
            InitializeComponent();
            

        }

        protected override void OnStart(string[] args)
        {
            HttpChannel channel = new HttpChannel(12345);
            ChannelServices.RegisterChannel(channel);
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(ChatServerObject), "ChatSeverAddress", WellKnownObjectMode.Singleton);
        }

        protected override void OnStop()
        {
            base.Stop();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer Shell Oil
United States United States
I am working as a Senior Software Developer with Shell Oil,Houston Texas USA.

Comments and Discussions