Robert Jordan
10/24/2004 1:10:00 PM
Hi Kazi,
> I woul like to create an application which connects to other instances of
> itself on different computers. There is only one application with one binary
> .exe file, and the connection is made by a client activated remote object.
>
> The problem is that I cannot register the client activated remote object
> ("Session" in this case) as ServiceType and ClientType with the following
> functions:
>
> RemotingConfiguration.RegisterActivatedServiceType(typeof(Session));
> RemotingConfiguration.RegisterActivatedClientType(typeof(Session),
> "tcp://ipaddress:3838");
>
> The second call refuses the registration. (The ipaddress is discovered
> dynamically.)
I don't think you can register the same type within the same
AppDomain as both service and client.
Just omit the RegisterActivatedClientType call, and, whenever
you need a remote Session instance, call this:
Session remoteSession = (Session)
RemotingServices.Connect(typeof(Session), "tcp://ipaddress:3838");
bye
Rob