tags:

views:

148

answers:

2

I am using .NET Remoting. My server/hoster is a Windows Service. It will sometimes work just fine and other times it will process one request and then it does not process any more (until I restart it). It is running as a windows service Here is the code from the Windows Service:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Linq;
    using System.Runtime.Remoting;
    using System.Runtime.Remoting.Channels;
    using System.Runtime.Remoting.Channels.Tcp;
    using System.ServiceProcess;
    using System.Text;
    using Remoting;

    namespace CreateReview
    {
        public partial class Service1 : ServiceBase
        {
            public Service1()
            {
                InitializeComponent();
            }

            readonly TcpChannel channel = new TcpChannel(8180);

            protected override void OnStart(string[] args)
            {
                // Create an instance of a channel
                ChannelServices.RegisterChannel(channel, false);

                // Register as an available service with the name HelloWorld
                RemotingConfiguration.RegisterWellKnownServiceType(
                    typeof(SampleObject),
                    "SetupReview",
                    WellKnownObjectMode.SingleCall);
            }

            protected override void OnStop()
            {

            }
        }
    }

Thanks for any help offered.

Vaccano

A: 

as a SingleCall type, your SampleObject will be created for every call the client makes. This suggests to me that your object is at fault, and you don't show what it does. You need to look at any dependancies it has on shared resources orlocks. Try writing some debug out in the SampleObject's constructor to see how far the remoting call gets.

gbjbaanb
A: 

Thanks,

Being new to remoting I was not sure if it was my object or my service that was at fault. I will debug into my object and see what I can find.

Thanks again.

Vaccano

Vaccano