473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1498
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

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

Similar topics

7
by: Nick Zdunic | last post by:
I have a remotable object running in my host application. The host starts up and creates the object. Within a method to start the remote object doing its thing it creates an object. ...
10
by: E. Robert Tisdale | last post by:
Could somebody please help me with the definition of a singleton? > cat singleton.cc class { private: // representation int A; int B; public: //functions
3
by: Alicia Roberts | last post by:
Hello everyone, I have been researching the Singleton Pattern. Since the singleton pattern uses a private constructor which in turn reduces extendability, if you make the Singleton Polymorphic...
3
by: Harry | last post by:
Hi ppl I have a doubt on singleton class. I am writing a program below class singleton { private: singleton(){}; public: //way 1
5
by: Pelle Beckman | last post by:
Hi, I've done some progress in writing a rather simple singleton template. However, I need a smart way to pass constructor arguments via the template. I've been suggested reading "Modern C++...
2
by: Dan | last post by:
I am having a problem trying to assign event handlers to the events of a remoted object. I have one program that registers the object for remoting, Another that connects and calls methods on the...
1
by: Steve Drake | last post by:
All, I have a WEBPAGE that needs to pass the current credentials to a .NET remoted object so this can pass the credentials to a SOAP WEBSERVICE (All written in C#) But I cannot see how I pass...
3
by: Grant Schenck | last post by:
Hello, I have a Windows Service developed in C# .NET. I'm making it a remote server and I can, via an IPC Channel, expose methods and call them from a client. However, I now want my remoted...
3
weaknessforcats
by: weaknessforcats | last post by:
Design Pattern: The Singleton Overview Use the Singleton Design Pattern when you want to have only one instance of a class. This single instance must have a single global point of access. That...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.