473,230 Members | 4,185 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,230 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 1491
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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.