we know that if the type is registered as singleton in the host side, then
all the remoting clients share one object, like:
host:
=====
TcpServerChannel chn = new TcpServerChannel(9999);
ChannelServices.RegisterChannel(chn,true);
RemotingConfiguration.RegisterWellKnownServiceType (typeof(SomeClass),
"someclass",WellKnownObjectMode.SingleCall);
========
client:
===========
SomeClass a = (SomeClass)Activator.GetObject(typeof(SomeClass),
@"tcp://172.16.64.190:9999/mul");
===========
now that all the remoting clients share one object, is there anyway i can
capture this object shared by the client? or can i just "new" an object and
then register this very object instead of the type of it on the host side so
i can control the state and behavior of it.
thankx 3 4932
Not entirely sure about the answer to your question (although I will look),
however, the line:
RemotingConfiguration.RegisterWellKnownServiceType (typeof(SomeClass),
"someclass",WellKnownObjectMode.SingleCall);
doesnt make a singleton. The WellKnownObjectMode.SingleCall means one per
client. WellKnownObjectMode.Singleton means one shared object
--
Ciaran O''''Donnell http://wannabedeveloper.spaces.live.com
"fairyvoice" wrote:
we know that if the type is registered as singleton in the host side, then
all the remoting clients share one object, like:
host:
=====
TcpServerChannel chn = new TcpServerChannel(9999);
ChannelServices.RegisterChannel(chn,true);
RemotingConfiguration.RegisterWellKnownServiceType (typeof(SomeClass),
"someclass",WellKnownObjectMode.SingleCall);
========
client:
===========
SomeClass a = (SomeClass)Activator.GetObject(typeof(SomeClass),
@"tcp://172.16.64.190:9999/mul");
===========
now that all the remoting clients share one object, is there anyway i can
capture this object shared by the client? or can i just "new" an object and
then register this very object instead of the type of it on the host side so
i can control the state and behavior of it.
thankx
I cant see anything from the framework to do this but one easy answer is to
have a static property on the server type which each instance sets to itself
on activation. For a singleton, there should only be one so it should work
nicely. Then you can access this property on the server. You will need to
ensure thread safety on all methods and properties though.
--
Ciaran O''''Donnell http://wannabedeveloper.spaces.live.com
"fairyvoice" wrote:
we know that if the type is registered as singleton in the host side, then
all the remoting clients share one object, like:
host:
=====
TcpServerChannel chn = new TcpServerChannel(9999);
ChannelServices.RegisterChannel(chn,true);
RemotingConfiguration.RegisterWellKnownServiceType (typeof(SomeClass),
"someclass",WellKnownObjectMode.SingleCall);
========
client:
===========
SomeClass a = (SomeClass)Activator.GetObject(typeof(SomeClass),
@"tcp://172.16.64.190:9999/mul");
===========
now that all the remoting clients share one object, is there anyway i can
capture this object shared by the client? or can i just "new" an object and
then register this very object instead of the type of it on the host side so
i can control the state and behavior of it.
thankx
1.do you mean that i design the server type as a singleton (using the
singleton pattern as showned in the book of GOF)?
2.it is really my stupid mistake the the codes given previous, i actually
meant WellKnownObjectMode.Singleton This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Fadi |
last post by:
Backround:
I am trying to figure out how to do the equivalant of a classic COM
Local Server Singleton in .NET/C#. I created a coupld of simple Class
Libs that exposes public interfaces and hosted...
|
by: Nak |
last post by:
Hi there,
I have been messing around with remoting in an attempt to create a
"shared application" as mentioned in another thread by that name.
I have created a singleton object just like the...
|
by: AMDRIT |
last post by:
Hello folks,
I appologize for the cross post, but I really need an answer on this:
I do not think that I am seeing the whole picture here. I would like to
create a windows service and a...
|
by: james.cssa |
last post by:
When I try to compile the following program on Visual Studio 2005 Pro,
the namespace System.Runtime.Remoting.Channels.Tcp is not recongized by
the compiler. (The "Tcp" part is highlighted.) And I...
|
by: mitch |
last post by:
Hello,
Basically, I want my application to run only one instance at a time and pass
command line arguments to a running instance. I have all of this working, I
used the IPC Remoting channel and...
| |
by: Palvinder Singh |
last post by:
Hello google group peeps,
I am new to remoting, but have a grasp of it.
I am trying to create a server/client application, which will be
deployed over an intranet. I have upwards of five...
|
by: Rich |
last post by:
Can anyone suggest a good (current) tutorial on how to do basic
remoting with C# (2005 express edition)?
|
by: José Joye |
last post by:
Hello,
What is the best way to stop a remoting server (Singleton SAO) that has been
started with RemotingConfiguration.Configure().
For sure, I want to do this without quitting the application...
|
by: erbilkonuk |
last post by:
Hi,
I am very new to .NET Remoting and I try to run a simple program to
subscribe to an event raised by Remoting Class. The Remoting Server
initiates an instance of Remoting Class as Singleton /...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
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...
|
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...
|
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: 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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |