473,799 Members | 3,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoted CAO acting like a SAO Singleton

2 New Member
I have a number of remotable DLLs, which are hosted by a Windows Service. The Windows Service simply registers the remotable DLLs using RemotingConfigu ration.Configur e. The configuration file is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.runtime .remoting>
<application name="UniConnec t">
<service>
<wellknown mode="SingleCal l" type="Northgate .HRS.UniConnect .UCRegistry, ZUCRegistry" objectUri="Regi stryServer.rem"/>
<wellknown mode="SingleCal l" type="Northgate .HRS.UniConnect .UCMailServer, ZUCMailServer" objectUri="Mail Server.rem"/>
<wellknown mode="SingleCal l" type="Northgate .HRS.UniConnect .UCDatabase, ZUCDatabase" objectUri="Data baseServer.rem"/>
<activated type="Northgate .HRS.UniConnect .UCHostServer, ZUCHostServer"/>
</service>
<channels>
<channel ref="tcp" port="1608">
<serverProvider s>
<formatter ref="binary" typeFilterLevel ="Full"/>
</serverProviders >
<clientProvider s>
<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 RemotingConfigu ration.Configur e. The configuration file is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<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">
<clientProvider s>
<formatter ref="binary"/>
</clientProviders >
<serverProvider s>
<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 1520
Dave Evans
2 New Member
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
1936
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. This object reference is passed into another object create within the same
10
2659
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
2501
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 what sort of problems/issues should be considered? Also, I see that a singleton needs to be set up with certain data such as file name, database URL etc. What issues are involved in this, and how would you do this? If someone knows about the...
3
3928
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
5312
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++ Design" or similar books, but I feel there are full of clever guys here who could help me out.
2
4428
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 object and a third that connects to the object and waits for events. The error occurs when I try to assign event handlers to the remoted object's events in the third program (Listener). hubListenerConnection.ContextRequest += new...
1
1710
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 credentials to the remoted object, any ideas? If there was no remote layer then I could just do :
3
2507
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 object to be able to invoke a method on my server object and given that the object is built in a C# Class DLL shared between the client and server I'm not sure how to get access to the server object from the remoted object. So, what techniques...
3
18255
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 is, regardless of where the object is hidden, everyone needs access to it. The global point of access is the object's Instance() method. Individual users need to be prevented from creating their own instances of the Singleton.
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.