Remoting question

  • Thread starter Thread starter Sharon Tal
  • Start date Start date
S

Sharon Tal

Hi all.
This is my remoting client:
public class WebClient
{
static WebClient()
{
ChannelServices.RegisterChannel(new TcpChannel());
m_GatewayClient = (IGateway)Activator.GetObject(typeof(IGateway),
"tcp://localhost:7777/Gateway");
}

private static IGateway m_GatewayClient;

public static void SendMsg(string msg)
{
m_GatewayClient.SendMsg("sup?");
}

}

As you see, i'll be using only one instance, of what ever the Activator
returns.
I think its ok because the server obj is registered as single call.
But i'm not sure.
Should each client get its own instance?
Thanks, Sharon.
 
With server activated objects the clients do not get an instance of the
remote object, instead they get a proxy to the remote object. In your
case it seems OK for the object to be SingleCall. For SingleCall remote
objects , the remote object gets instantaniated when the SendMsg method
is called and are killed when the method call finishes.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
 
Back
Top