Window Service not able to call remoting object

Aug 31 2009 6:05 AM
Hi All,

I have created a simple remoting server inside a Window Service as :

TcpChannel tcpChannel = new TcpChannel(8085);
            ChannelServices.RegisterChannel(tcpChannel,true);
            WellKnownServiceTypeEntry entry = new WellKnownServiceTypeEntry("RemotingWindowSrvc", "RemotingWindowSrvc.MailFormat", "MailFormat", WellKnownObjectMode.SingleCall);
            RemotingConfiguration.RegisterWellKnownServiceType(entry);

Then we try and make call to this server in my client as:

private void GetRemoteObject()
        {
            TcpChannel chan = new TcpChannel();
            ChannelServices.RegisterChannel(chan);

            MailFormat obj = (MailFormat)Activator.GetObject(typeof(MailFormat), "tcp://localhost:8085/MailFormat");

            obj.sendUserRegistration("...");    
        }
    }

MailFormat: is the name of the Class, being called here.

But upon calling "obj.sendUserRegistration("...");", client hangs indefinitely.

please help me with this.

Thanks,

Puneet


Answers (1)