Remoting Object in Window Service - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Remoting Object in Window Service

puneetshadijapuneetshadija Posts: 4Member
Hi All,

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

TcpChannel tcpChannel = new TcpChannel(8085);
WellKnownServiceTypeEntry entry = new WellKnownServiceTypeEntry("RemotingWindowSrvc", "RemotingWindowSrvc.MailFormat", "MailFormat", WellKnownObjectMode.SingleCall);

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

private void GetRemoteObject()
TcpChannel chan = new TcpChannel();

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


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

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

please help me with this.




  • DataDinkDataDink Posts: 135Member
    you know if you guys just use WCF services you don't have to deal with all this stuff.

    So is MailFormat a class that you have created?

    if so - what's going on in the sendUserRegistration method? can you post it?

    Also - is it hanging indefinitely - or if you wait like 10 minutes does it time out?

  • puneetshadijapuneetshadija Posts: 4Member

    Thanks a lot for the reply, I have been able to solve this problem.

    It was hanging cause, it wasn't able to resolve the function name. But once I signed the assembly and deployed it in GAC, it was able to recognize it and call the function.

    I am putting the code for your reference:

    Dim ch As TcpChannel = New TcpChannel(8085)
    RemotingConfiguration.RegisterWellKnownServiceType( _
    GetType(TrialClassLib.MailFormat), "myRemoteObject", WellKnownObjectMode.Singleton)
  • yadhavyadhav Posts: 1Member
    how to two system are chating ... codeing pls
Sign In or Register to comment.