> > Things such as configuration parameters. It would be nice if the
> > remoted object instance in the could call functions in the service
[quoted text clipped - 19 lines]
> inside the service that inherits from the abstract class and performs
> the work.
> My client(s) get a reference to the service-hosted remote object. But, I am
> having a real problem figuring a (fast) way to determine when the service is
> stopped (or the machine is rebooted, power fails, etc). of course, I will
> eventually (after several seconds) trap the "The underlying connection was
> closed: Unable to connect to the remote server" error, but is there any way
> to do this more efficiently?
I can't think of any better way, but I don't have a lot of experience at
this. However, both of the supplied channels use TCP as their underlying
mechanism, so theoretically when the service is shutdown gracefully the
open TCP socket will receive a "disconnect" from the server. Whether
that's visible at any higher layers and can be acted upon... no idea.
Most likely a third-party channel could provide a solution to this
problem (I've look at the GenuineChannels stuff and it looks nice, but
it's overkill for my application).
GeorgeG - 18 Jan 2004 19:58 GMT
Hi,
I recently did a similar project and I had the same problem, ie clients
could not know if the server is up with its remoted objects.
Unfortunatly I could not find anything on how to do it 'properly'. So I have
the clients trying to call a method on the server every few minites. If the
server is not up then tcp will throw an exception "host actively refused the
connection" which means no one is listening on the port on the server side.
Also after a method call the tcpchannel will be up only for a short "unused"
time. ie if you dont call your method frequent the tcpchannel will drop.
Note that if you have a callback object then u will see that the client is
creating a listener socket (remoting level) on the just failed method call
socket. Use tcpview to see this.. weird.. i had a case where the GC was not
collecting these objects..freaky stuff..
- George.
> > My client(s) get a reference to the service-hosted remote object. But, I am
> > having a real problem figuring a (fast) way to determine when the service is
[quoted text clipped - 12 lines]
> problem (I've look at the GenuineChannels stuff and it looks nice, but
> it's overkill for my application).