[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

check if server is alive in drb

Mr_Tibs

8/28/2007 8:12:00 AM

Hi,

Is there any elegant method for checking if a drb server is still
alive from the client side?

My server notifies my client when it finished a job through the
observer method. However, it is possible that the server dies (or the
network connection gets broken), and I need to detect this. I
implemented a thread which continously "pings" (calls a simple
remote_obj.ping) and rescues any exceptions in this method call. Is
there a better solution out there?

Thanks,
Tiberiu

3 Answers

Eric Hodel

9/9/2007 9:42:00 PM

0

On Aug 28, 2007, at 01:15, Mr_Tibs wrote:
> Is there any elegant method for checking if a drb server is still
> alive from the client side?
>
> My server notifies my client when it finished a job through the
> observer method. However, it is possible that the server dies (or the
> network connection gets broken), and I need to detect this. I
> implemented a thread which continously "pings" (calls a simple
> remote_obj.ping) and rescues any exceptions in this method call. Is
> there a better solution out there?

Nope.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars



ara.t.howard

9/10/2007 12:09:00 AM

0


On Aug 28, 2007, at 2:15 AM, Mr_Tibs wrote:

>
> My server notifies my client when it finished a job through the
> observer method. However, it is possible that the server dies (or the
> network connection gets broken), and I need to detect this. I
> implemented a thread which continously "pings" (calls a simple
> remote_obj.ping) and rescues any exceptions in this method call. Is
> there a better solution out there?

depending on how many clients there are each one can call a method on
the server that never returns (Thread.sleep). if the method ever
returns in the client it knows the server has died. this obviously
only works for a small number of clients.

a @ http://draw...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




Marcin Raczkowski

9/10/2007 6:27:00 AM

0

ara.t.howard wrote:
>
> On Aug 28, 2007, at 2:15 AM, Mr_Tibs wrote:
>
>>
>> My server notifies my client when it finished a job through the
>> observer method. However, it is possible that the server dies (or the
>> network connection gets broken), and I need to detect this. I
>> implemented a thread which continously "pings" (calls a simple
>> remote_obj.ping) and rescues any exceptions in this method call. Is
>> there a better solution out there?
>
> depending on how many clients there are each one can call a method on
> the server that never returns (Thread.sleep). if the method ever
> returns in the client it knows the server has died. this obviously only
> works for a small number of clients.
>
> a @ http://draw...
> --
> we can deny everything, except that we have the possibility of being
> better. simply reflect on that.
> h.h. the 14th dalai lama
>
>
>
>
>
hmm that's good idea for keeping connections alive i guess :) i had
problems that frequent requests over ssl were making huge overhead.