471,082 Members | 765 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,082 software developers and data experts.

Remoted CAO acting like a SAO Singleton

I have a number of remotable DLLs, which are hosted by a Windows Service. The Windows Service simply registers the remotable DLLs using RemotingConfiguration.Configure. The configuration file is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="UniConnect">
<service>
<wellknown mode="SingleCall" type="Northgate.HRS.UniConnect.UCRegistry, ZUCRegistry" objectUri="RegistryServer.rem"/>
<wellknown mode="SingleCall" type="Northgate.HRS.UniConnect.UCMailServer, ZUCMailServer" objectUri="MailServer.rem"/>
<wellknown mode="SingleCall" type="Northgate.HRS.UniConnect.UCDatabase, ZUCDatabase" objectUri="DatabaseServer.rem"/>
<activated type="Northgate.HRS.UniConnect.UCHostServer, ZUCHostServer"/>
</service>
<channels>
<channel ref="tcp" port="1608">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>

I have a client application, which at start up, registers the remotable objects using RemotingConfiguration.Configure. The configuration file is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client url="tcp://localhost:1608/UniConnect">
<wellknown type="Northgate.HRS.UniConnect.UCRegistry, ZUCRegistry" url="tcp://localhost:1608/RegistryServer.rem"/>
<wellknown type="Northgate.HRS.UniConnect.UCMailServer, ZUCMailServer" url="tcp://localhost:1608/MailServer.rem"/>
<wellknown type="Northgate.HRS.UniConnect.UCDatabase, ZUCDatabase" url="tcp://localhost:1608/DatabaseServer.rem"/>
<activated type="Northgate.HRS.UniConnect.UCHostServer, ZUCHostServer" url="tcp://localhost:1608/UniConnect"/>
</client>
<channels>
<channel ref="tcp" port="0">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>

Everything appears to work OK for the SAOs, but the CAO only ever gets instantiated once.

I start two copies of the client application, and both get the same CAO object. I can see this because I write information out to a log file.

If I remove the CAO from remoting altogether, everything is fine; I get a different object for each client.

Unfortunately, this object MUST be a CAO, as I need separate state information for each client.

I currently have no interfaces involved, and use New to instantiate the object.

I have tried using interfaces and a factory. I have tried using soapsuds. I have tried registering the CAO on the client side in the code, rather than using the configuration file. All to no avail; the CAO always acts like a Singleton SAO, when remoting is involved.

I imagine that I am doing something incredibly stupid, but I have now spent about 8 days trying out various methods, with no success.

Please help.

This is all running on my XP box, but I have remoted to another PC successfully, albeit that the CAO acts the same.

The remotable objects, the Windows Service and the Client are all written in VB.NET.
Mar 8 '07 #1
1 1417
I have solved the problem I had.
Absolutely nothing to do with Remoting, although it appeared to be.
The problem was the use of Public variables in a shared module. Once these were put back into the Class, no problem!!
Mar 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Nick Zdunic | last post: by
10 posts views Thread by E. Robert Tisdale | last post: by
3 posts views Thread by Alicia Roberts | last post: by
3 posts views Thread by Harry | last post: by
5 posts views Thread by Pelle Beckman | last post: by
2 posts views Thread by Dan | last post: by
1 post views Thread by Steve Drake | last post: by
3 posts views Thread by Grant Schenck | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.