1
Answer

Window Service not able to call remoting object

puneetshadija

puneetshadija

15y
4.5k
1
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)