473,714 Members | 4,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to shutdown a remoting Server (SAO-Singleton started with RemotingConfigu ration.Configur e())

Hello,

What is the best way to stop a remoting server (Singleton SAO) that has been
started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to stop
the remoting functionality within my process.

Many thanks,

- José
Jan 23 '07 #1
13 1889
Others may know better, but I would say either to set the lifetime to a
suitable value, or use SingleCall objects (instead of Singletons) that die
as soon as any method on them is completed.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45******** *************** @news.sunrise.c h...
Hello,

What is the best way to stop a remoting server (Singleton SAO) that has
been started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to stop
the remoting functionality within my process.

Many thanks,

- José

Jan 24 '07 #2
Hello Peter,

Thanks,
However, I do not want to recycle my remoted object. I want to prevent any
client from using my remoting Server. I want to be able to shutdown the
fonctionality at a given time.

- José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eF******** ******@TK2MSFTN GP03.phx.gbl...
Others may know better, but I would say either to set the lifetime to a
suitable value, or use SingleCall objects (instead of Singletons) that die
as soon as any method on them is completed.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45******** *************** @news.sunrise.c h...
>Hello,

What is the best way to stop a remoting server (Singleton SAO) that has
been started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to stop
the remoting functionality within my process.

Many thanks,

- José


Jan 24 '07 #3
Hi Jose
However, I do not want to recycle my remoted object
I don't know what you mean by "recycle". I hope it doesn't mean that you
are using your Singleton object as a stateful object (i.e. to use state it
retains between calls). This would be a very bad idea. If you want to
retain state, you should use CAOs. Using SingeCall SAOs is more scalable
anyway - and more in tune with the move to a Service Oriented Architecture
(IMHO and from what I've read).
>I want to prevent any client from using my remoting Server.
Do you mean that you want to stop the server? Or are you trying to
distinguish between clients? If the former, just stop the service on the
remote server. If the latter, couldn't you use your security credentials
info?
>I want to be able to shutdown the fonctionality at a given time.
For everyone? Shut down the service on the server.

We always use configuration files for remoting, as well. It means that you
can make lots of changes on the fly just be changing a setting or two in the
config file.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45******** *************** @news.sunrise.c h...
Hello Peter,

Thanks,
However, I do not want to recycle my remoted object. I want to prevent any
client from using my remoting Server. I want to be able to shutdown the
fonctionality at a given time.

- José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eF******** ******@TK2MSFTN GP03.phx.gbl...
>Others may know better, but I would say either to set the lifetime to a
suitable value, or use SingleCall objects (instead of Singletons) that
die as soon as any method on them is completed.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45******* *************** *@news.sunrise. ch...
>>Hello,

What is the best way to stop a remoting server (Singleton SAO) that has
been started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to
stop the remoting functionality within my process.

Many thanks,

- José



Jan 24 '07 #4
Hello Peter,

Thanks for your feedback.

Regarding the first part of your answer, you're right it is not a good idea
to keep state in this object (at least not state of the art...). Any way,
yesterday night, I changed my mind in turn it to a SingleCall object.

Now, back to my initial problem. I really want to stop the remoting
functionality. This means no client will be able to connect any more from a
given point of time.
I do not really follow you when you say, "just stop the Server". In fact, my
"remoting Server" will be hosted within a process that will keep running
eventhough the remoting functionality is stopped.

So, is there any method to call to stop the remoting server?

To start it --------RemotingConfigu ration.Configur e().
To stop it:---------?????

Thanks,
-José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:OV******** ******@TK2MSFTN GP04.phx.gbl...
Hi Jose
>However, I do not want to recycle my remoted object

I don't know what you mean by "recycle". I hope it doesn't mean that you
are using your Singleton object as a stateful object (i.e. to use state it
retains between calls). This would be a very bad idea. If you want to
retain state, you should use CAOs. Using SingeCall SAOs is more scalable
anyway - and more in tune with the move to a Service Oriented Architecture
(IMHO and from what I've read).
>>I want to prevent any client from using my remoting Server.

Do you mean that you want to stop the server? Or are you trying to
distinguish between clients? If the former, just stop the service on the
remote server. If the latter, couldn't you use your security credentials
info?
>>I want to be able to shutdown the fonctionality at a given time.

For everyone? Shut down the service on the server.

We always use configuration files for remoting, as well. It means that
you can make lots of changes on the fly just be changing a setting or two
in the config file.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45******** *************** @news.sunrise.c h...
>Hello Peter,

Thanks,
However, I do not want to recycle my remoted object. I want to prevent
any client from using my remoting Server. I want to be able to shutdown
the fonctionality at a given time.

- José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eF******* *******@TK2MSFT NGP03.phx.gbl.. .
>>Others may know better, but I would say either to set the lifetime to a
suitable value, or use SingleCall objects (instead of Singletons) that
die as soon as any method on them is completed.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45****** *************** **@news.sunrise .ch...
Hello,

What is the best way to stop a remoting server (Singleton SAO) that has
been started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to
stop the remoting functionality within my process.

Many thanks,

- José



Jan 24 '07 #5
Presumably, your remote object is hosted within a Windows Service. This is
the usual method. If you want to cut your users off, just stop the service.
The first time you try to call a method on the remote object (NB: NOT when
you create the proxy instance, which is done exclusively on the client), an
exception will be thrown, because the Windows service will be stopped. The
actual error message says something about the server actively refusing
requests on that port.

All you need to do is to intercept that exception and send some nice,
friendly message to the user, along the lines of, "The service is
temporarily unavailable. Please try again later. In fact, you could put
the message in a config file so that you can alter it to suit your
circumstances.

Does that help?

This is all .NET 1.1 stuff, by the way. It might be even easier in 2.0. I
wouldn't know. Yet.
Peter
"José Joye" <Me@me.comwro te in message
news:45******** *************** @news.sunrise.c h...
Hello Peter,

Thanks for your feedback.

Regarding the first part of your answer, you're right it is not a good
idea to keep state in this object (at least not state of the art...). Any
way, yesterday night, I changed my mind in turn it to a SingleCall object.

Now, back to my initial problem. I really want to stop the remoting
functionality. This means no client will be able to connect any more from
a given point of time.
I do not really follow you when you say, "just stop the Server". In fact,
my "remoting Server" will be hosted within a process that will keep
running eventhough the remoting functionality is stopped.

So, is there any method to call to stop the remoting server?

To start it --------RemotingConfigu ration.Configur e().
To stop it:---------?????

Thanks,
-José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:OV******** ******@TK2MSFTN GP04.phx.gbl...
>Hi Jose
>>However, I do not want to recycle my remoted object

I don't know what you mean by "recycle". I hope it doesn't mean that you
are using your Singleton object as a stateful object (i.e. to use state
it retains between calls). This would be a very bad idea. If you want
to retain state, you should use CAOs. Using SingeCall SAOs is more
scalable anyway - and more in tune with the move to a Service Oriented
Architecture (IMHO and from what I've read).
>>>I want to prevent any client from using my remoting Server.

Do you mean that you want to stop the server? Or are you trying to
distinguish between clients? If the former, just stop the service on the
remote server. If the latter, couldn't you use your security credentials
info?
>>>I want to be able to shutdown the fonctionality at a given time.

For everyone? Shut down the service on the server.

We always use configuration files for remoting, as well. It means that
you can make lots of changes on the fly just be changing a setting or two
in the config file.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45******* *************** *@news.sunrise. ch...
>>Hello Peter,

Thanks,
However, I do not want to recycle my remoted object. I want to prevent
any client from using my remoting Server. I want to be able to shutdown
the fonctionality at a given time.

- José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eF****** ********@TK2MSF TNGP03.phx.gbl. ..
Others may know better, but I would say either to set the lifetime to a
suitable value, or use SingleCall objects (instead of Singletons) that
die as soon as any method on them is completed.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45***** *************** ***@news.sunris e.ch...
Hello,
>
What is the best way to stop a remoting server (Singleton SAO) that
has been started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)
>
In fact, at a given time based on an internal event, I would like to
stop the remoting functionality within my process.
>
Many thanks,
>
- José
>




Jan 24 '07 #6
Hello again,

No, it is not a windows Service. For several reason, this is not hosted in a
windows Service but in a normal process that has also other small taks to
perform.
This means I can not stop the service or terminate the process.

- José
"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Presumably, your remote object is hosted within a Windows Service. This
is the usual method. If you want to cut your users off, just stop the
service. The first time you try to call a method on the remote object (NB:
NOT when you create the proxy instance, which is done exclusively on the
client), an exception will be thrown, because the Windows service will be
stopped. The actual error message says something about the server
actively refusing requests on that port.

All you need to do is to intercept that exception and send some nice,
friendly message to the user, along the lines of, "The service is
temporarily unavailable. Please try again later. In fact, you could put
the message in a config file so that you can alter it to suit your
circumstances.

Does that help?

This is all .NET 1.1 stuff, by the way. It might be even easier in 2.0.
I wouldn't know. Yet.
Peter
"José Joye" <Me@me.comwro te in message
news:45******** *************** @news.sunrise.c h...
>Hello Peter,

Thanks for your feedback.

Regarding the first part of your answer, you're right it is not a good
idea to keep state in this object (at least not state of the art...). Any
way, yesterday night, I changed my mind in turn it to a SingleCall
object.

Now, back to my initial problem. I really want to stop the remoting
functionalit y. This means no client will be able to connect any more from
a given point of time.
I do not really follow you when you say, "just stop the Server". In fact,
my "remoting Server" will be hosted within a process that will keep
running eventhough the remoting functionality is stopped.

So, is there any method to call to stop the remoting server?

To start it --------RemotingConfigu ration.Configur e().
To stop it:---------?????

Thanks,
-José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:OV******* *******@TK2MSFT NGP04.phx.gbl.. .
>>Hi Jose

However, I do not want to recycle my remoted object

I don't know what you mean by "recycle". I hope it doesn't mean that
you are using your Singleton object as a stateful object (i.e. to use
state it retains between calls). This would be a very bad idea. If you
want to retain state, you should use CAOs. Using SingeCall SAOs is more
scalable anyway - and more in tune with the move to a Service Oriented
Architectur e (IMHO and from what I've read).

I want to prevent any client from using my remoting Server.

Do you mean that you want to stop the server? Or are you trying to
distinguish between clients? If the former, just stop the service on
the remote server. If the latter, couldn't you use your security
credentials info?

I want to be able to shutdown the fonctionality at a given time.

For everyone? Shut down the service on the server.

We always use configuration files for remoting, as well. It means that
you can make lots of changes on the fly just be changing a setting or
two in the config file.

HTH
Peter

"José Joye" <Me@me.comwro te in message
news:45****** *************** **@news.sunrise .ch...
Hello Peter,

Thanks,
However, I do not want to recycle my remoted object. I want to prevent
any client from using my remoting Server. I want to be able to shutdown
the fonctionality at a given time.

- José

"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eF***** *********@TK2MS FTNGP03.phx.gbl ...
Others may know better, but I would say either to set the lifetime to
a suitable value, or use SingleCall objects (instead of Singletons)
that die as soon as any method on them is completed.
>
HTH
>
>
Peter
>
"José Joye" <Me@me.comwro te in message
news:45**** *************** ****@news.sunri se.ch...
>Hello,
>>
>What is the best way to stop a remoting server (Singleton SAO) that
>has been started with RemotingConfigu ration.Configur e().
>For sure, I want to do this without quitting the application :-)
>>
>In fact, at a given time based on an internal event, I would like to
>stop the remoting functionality within my process.
>>
>Many thanks,
>>
>- José
>>
>
>




Jan 24 '07 #7
Jose,

I am in the same (or similar) boat with you on this. For a while, I've been
wanting to stop (or prohibit) server object providing any further services to
client although the [Window] service itself (or any other ways your server
object may be hosted) is still running. One scenario of this is the service
hosts 3 server objects, and I want to prohibit on one [at runtime] while
leaving the other 2 running. How do I do that?

Apparently, it's not obvious and as far as I know, there's none. My thinking
is that you just have to somehow play trick inside your object to intercept
every (yes, every) single call to check for whether the object is currently
available for service or not. That also means your object is not stopped;
it's just not providing services.

I hope that helps.

--
Your 2 cents are worth $milion$. Thanks.
"José Joye" wrote:
Hello,

What is the best way to stop a remoting server (Singleton SAO) that has been
started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to stop
the remoting functionality within my process.

Many thanks,

- José
Jan 26 '07 #8
Hello,

Thanks for your feedback,

In fact I still did not find any viable solution to the problem. I'm
wondering if the ChannelServices .UnregisterChan nel() Method .
I will try it in the next days....

- José

"mtv" <mt*@discussion s.microsoft.com a écrit dans le message de news:
D6************* *************** **...icrosof t.com...
Jose,

I am in the same (or similar) boat with you on this. For a while, I've
been
wanting to stop (or prohibit) server object providing any further services
to
client although the [Window] service itself (or any other ways your server
object may be hosted) is still running. One scenario of this is the
service
hosts 3 server objects, and I want to prohibit on one [at runtime] while
leaving the other 2 running. How do I do that?

Apparently, it's not obvious and as far as I know, there's none. My
thinking
is that you just have to somehow play trick inside your object to
intercept
every (yes, every) single call to check for whether the object is
currently
available for service or not. That also means your object is not stopped;
it's just not providing services.

I hope that helps.

--
Your 2 cents are worth $milion$. Thanks.
"José Joye" wrote:
>Hello,

What is the best way to stop a remoting server (Singleton SAO) that has
been
started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to stop
the remoting functionality within my process.

Many thanks,

- José

Jan 26 '07 #9
If you host multiple remote objects [by a single host] like mine,
unregistering will shut down availability for all objects. So, if you have
one object per service, it will work but that is not much different from
shutting down the service itself.

What's your architecture like? BTW, have you checked out Genuine Channels
component? It may provide this feature.
--
Your 2 cents are worth $milion$. Thanks.
"José Joye" wrote:
Hello,

Thanks for your feedback,

In fact I still did not find any viable solution to the problem. I'm
wondering if the ChannelServices .UnregisterChan nel() Method .
I will try it in the next days....

- José

"mtv" <mt*@discussion s.microsoft.com a écrit dans le message de news:
D6************* *************** **...icrosof t.com...
Jose,

I am in the same (or similar) boat with you on this. For a while, I've
been
wanting to stop (or prohibit) server object providing any further services
to
client although the [Window] service itself (or any other ways your server
object may be hosted) is still running. One scenario of this is the
service
hosts 3 server objects, and I want to prohibit on one [at runtime] while
leaving the other 2 running. How do I do that?

Apparently, it's not obvious and as far as I know, there's none. My
thinking
is that you just have to somehow play trick inside your object to
intercept
every (yes, every) single call to check for whether the object is
currently
available for service or not. That also means your object is not stopped;
it's just not providing services.

I hope that helps.

--
Your 2 cents are worth $milion$. Thanks.
"José Joye" wrote:
Hello,

What is the best way to stop a remoting server (Singleton SAO) that has
been
started with RemotingConfigu ration.Configur e().
For sure, I want to do this without quitting the application :-)

In fact, at a given time based on an internal event, I would like to stop
the remoting functionality within my process.

Many thanks,

- José


Jan 26 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2776
by: Per Bergland | last post by:
After many woes, I finally managed to get a stack dump of my System Service (written in C#) that insists on crashing when launched at system boot time (see below on how to get this dump - I couldn't find any info on how to do this). Here's the stack trace from cordbg: Unhandled exception generated: (0x04719c94) <System.Runtime.Remoting.RemotingException> _className=<null> _exceptionMethod=<null>
0
1037
by: JSheble | last post by:
I have a windows service that is actually a .NET Remoting Server, and in the OnStart I start up the Remoting server for accepting connections from a client app. In the OnStop event of the service, how can I turn off the .NET Remote server so it no longer accepts connections? Plus, disconnectes clients currently connected? Here's my OnStart: protected override void OnStart(string args) {
2
4120
by: Mantorok | last post by:
Hi Everytime my ASP.Net app starts it configures remoting using RemotingConfiguration.Configure methods. However, after the app has run once and then I try and run it again it throws an exception because the config has already been read. Why is the configuration is being held even when I finish the app and also restart IIS?
2
5117
by: Mantorok | last post by:
Hi I use RemotingCOnfiguration.Configure("App.config") to configure my ports, however sometimes after I have closed the app and restart it throws an exception "Only one usage of each socket address (protocol/network address/port) is normally permitted". Is there a way of closing ports after an app has finished runnning? Thanks
0
1082
by: Mas L via DotNetMonster.com | last post by:
Hi, I have a problem with getting values from the RemotingConfiguration. RemotingConfiguration::Configure ("RTC_cpp.exe.config"); RealTimeDataManager^ manager = gcnew RealTimeDataManager(); manager->FepConfigFileName = ConfigurationManager::AppSettings;
1
2042
by: big A | last post by:
I am writing an ASP.net application using the web.config file and RemotingConfiguration.Configure to define the remoting configuration. This technique works fine for the initial page load; however if the page is refreshed or accessed again, I receive the following error: Remoting configuration failed with the exception System.Runtime.Remoting.RemotingException: Attempt to redirect activation of type '<interface name>, <assembly>' which...
0
848
by: Mat | last post by:
i create a remote server which i want to use like windows servers. -On start i put the following code: Protected Overrides Sub OnStart(ByVal args() As String) Dim filename As String = "BroadCastservices.exe.config" RemotingConfiguration.Configure(filename)
13
4046
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 :-) In fact, at a given time based on an internal event, I would like to stop the remoting functionality within my process. Many thanks,
0
8808
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8712
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
9316
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
9077
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
9023
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
4729
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3160
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 we have to send another system
2
2525
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.