the call to function in remote object is stuck (lock)
- From: "dave" <dp_israel@xxxxxxxxx>
- Date: 18 Dec 2006 08:47:05 -0800
hi all,
I'm programming with VS2005 (c#) and I got problem when I implemented
local remoting
I created windows service that act like remote host, the service have
timer and run the
command RemotingConfiguration.Configure on OnStart function
the config file look like this:
<configuration>
<system.runtime.remoting>
<application name="RemoteHostService">
<service>
<wellknown type="RemoteObject.Sample, RemoteObject"
objectUri="RemoteObject.Sample" mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="8085">
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
the remote object contains this code:
using System;
using System.Diagnostics;
namespace RemoteObject
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Sample : MarshalByRefObject
{
public Sample()
{
//
// TODO: Add constructor logic here
//
}
public int Run()
{
return 0;
}
}
}
the relevant code in the the remote client:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
Sample samp = (Sample)Activator.GetObject(
typeof(RemoteObject.Sample),
"tcp://localhost:8085/RemoteObject.Sample");
if (samp == null)
System.Console.WriteLine("Could not locate server");
else
Console.WriteLine(samp.Run);
but the program stuck when it tries to call Run,
I'll appreciate if someone know how to fix it or why I have a problem
like this
Best Regards,
Dave
.
- Prev by Date: Re: How to secure,Encrypted,Signed without credentials in TcpClientCha
- Next by Date: Requested service is not found
- Previous by thread: Re: How to secure,Encrypted,Signed without credentials in TcpClientCha
- Next by thread: Requested service is not found
- Index(es):
Relevant Pages
|
Loading