G
GobinathP
Hi All,
I have a remote C# application running and I need a client to create an
object of the remote application.
I use TCP connection for the remoting.
In the Server side I have this code.
RemotingConfiguration.RegisterWellKnownServiceType(typeof(URTServiceFactory)
,"URTServiceFactory",WellKnownObjectMode.Singleton);
In the client side I have this code.
//make the tcp string based on the machine.
string sTcpStr = "tcp://";
sTcpStr += ( (machine=="") ||
(string.Compare(machine,"local",true)==0) )?"localhost":machine;
sTcpStr += ":801/URTServiceFactory";
//step 3 register all objects
RemotingConfiguration.RegisterWellKnownClientType(typeof(URTServiceFactory),
sTcpStr);
URTServiceFactory fact = new URTServiceFactory();
m_PlatService = fact.GetPlatformService();
The problem is - I'm able to create the object and use it. But the client is
a UI and I store the object created as member variable and use it when
necessary. If the object doesn't get used for sometime then it starts giving
error. I assume there is a timeout interval after which the connection gets
dropped.
Any idea how to set the timeout interval to infinity. Or is the mechanism
I'm using is wrong?
Thanks,
Gobi.
I have a remote C# application running and I need a client to create an
object of the remote application.
I use TCP connection for the remoting.
In the Server side I have this code.
RemotingConfiguration.RegisterWellKnownServiceType(typeof(URTServiceFactory)
,"URTServiceFactory",WellKnownObjectMode.Singleton);
In the client side I have this code.
//make the tcp string based on the machine.
string sTcpStr = "tcp://";
sTcpStr += ( (machine=="") ||
(string.Compare(machine,"local",true)==0) )?"localhost":machine;
sTcpStr += ":801/URTServiceFactory";
//step 3 register all objects
RemotingConfiguration.RegisterWellKnownClientType(typeof(URTServiceFactory),
sTcpStr);
URTServiceFactory fact = new URTServiceFactory();
m_PlatService = fact.GetPlatformService();
The problem is - I'm able to create the object and use it. But the client is
a UI and I store the object created as member variable and use it when
necessary. If the object doesn't get used for sometime then it starts giving
error. I assume there is a timeout interval after which the connection gets
dropped.
Any idea how to set the timeout interval to infinity. Or is the mechanism
I'm using is wrong?
Thanks,
Gobi.