Re: how to implement pinging
- From: Spam Catcher <spamhoneypot@xxxxxxxxxx>
- Date: Thu, 12 Apr 2007 18:59:08 GMT
"Robert Ludig" <schwertfischtrombose@xxxxxx> wrote in
news:1176357364.698091.170770@xxxxxxxxxxxxxxxxxxxxxxxxxxx:
On Apr 11, 8:59 pm, Spam Catcher <spamhoney...@xxxxxxxxxx> wrote:
"Robert Ludig" <schwertfischtromb...@xxxxxx> wrote
innews:1176277585.267836.321700@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
I have a long running remoting client that every once in a while
calls a method on a remoting server. The client constantly displays
the connection status. How can the remoting client find out that
the remoting server has become unavailable right after it happend?
Does .NET Remoting have any built in ping-like functionality? What
is the best practice in .NET Remoting for (keep) alive probing?
Unfortunately no - not in the default channels.
You'll need something like Geniune Channels.
However, with the built in channels, just create a timer and fire off
a function call to a dummy function on the server. If the function
times out (or errors), you know your connection is fubar.
There is only one problem with you suggested approach:
How do I control the timeout? When I call the remote server that is
not reachable the application hangs for a long time.
Run the ping in a separate thread so it does not lock up your GUI
thread.
(I haven't
figured out yet where that timespan comes from.) Not only do I want my
app to not hang but also I would like to specify my own timeout
timespan.
I think you can specify the timeout on certain .NET channels during the
setup. Check the configuration parameters ...
I could of course call the ping in a dedicated thread and
kill that thread if it does not return for a specified timespan but
one thread for each ping and each remoting client? That'd be a hell of
a lot threads.
You don't need to create multiple ping threads. Just have each client
ping the server with 1 thread (and reuse the thread). The server
responds to the ping with some dummy data.
.
- Follow-Ups:
- Re: how to implement pinging
- From: Robert Ludig
- Re: how to implement pinging
- References:
- how to implement pinging
- From: Robert Ludig
- Re: how to implement pinging
- From: Spam Catcher
- Re: how to implement pinging
- From: Robert Ludig
- how to implement pinging
- Prev by Date: Config file is found and loaded fine but no remote object.
- Next by Date: Re: how to implement pinging
- Previous by thread: Re: how to implement pinging
- Next by thread: Re: how to implement pinging
- Index(es):
Relevant Pages
|