Remoting question

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.
 
S

Sijin Joseph

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top