![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
#3
| |||
| |||
|
|
"Robert Ludig" <schwertfischtromb... (AT) gmx (DOT) de> wrote innews:1176277585.267836.321700 (AT) n59g2000hsh (DOT) googlegroups.com: 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. |
#4
| |||
| |||
|
|
On Apr 11, 8:59 pm, Spam Catcher <spamhoney... (AT) rogers (DOT) com> wrote: "Robert Ludig" <schwertfischtromb... (AT) gmx (DOT) de> wrote innews:1176277585.267836.321700 (AT) n59g2000hsh (DOT) googlegroups.com: 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. |
|
(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 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. |
#5
| |||
| |||
|
|
"Robert Ludig" <schwertfischtromb... (AT) gmx (DOT) de> wrote innews:1176357364.698091.170770 (AT) y5g2000hsa (DOT) googlegroups.com: On Apr 11, 8:59 pm, Spam Catcher <spamhoney... (AT) rogers (DOT) com> wrote: "Robert Ludig" <schwertfischtromb... (AT) gmx (DOT) de> wrote innews:1176277585.267836.321700 (AT) n59g2000hsh (DOT) googlegroups.com: 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.- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
"Robert Ludig" <schwertfischtrombose (AT) gmx (DOT) de> wrote in news:1176277585.267836.321700 (AT) n59g2000hsh (DOT) googlegroups.com: 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. |
#7
| |||
| |||
|
|
More recent OS versions have the WMI Win32_PingStatus class that you can call using the Management classes. There are some C# implementations out there, like this one: http://www.codeproject.com/dotnet/CSharpPing.asp -- Phil Wilson [Microsoft MVP-Windows Installer] "Spam Catcher" <spamhoney... (AT) rogers (DOT) com> wrote in message news:Xns990F9867EBC4Cusenethoneypotrogers (AT) 127 (DOT) 0.0.1... "Robert Ludig" <schwertfischtromb... (AT) gmx (DOT) de> wrote in news:1176277585.267836.321700 (AT) n59g2000hsh (DOT) googlegroups.com: 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.- Zitierten Text ausblenden - - Zitierten Text anzeigen - |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |