# Check if server is alive in drb

**URL:** <https://www.ruby-forum.com/t/check-if-server-is-alive-in-drb/113165>\
**Category:** Ruby\
**Created:** [August 28, 2007, 10:16am UTC](https://www.ruby-forum.com/t/check-if-server-is-alive-in-drb/113165 "2007-08-28T10:16:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [August 28, 2007, 10:16am UTC](https://www.ruby-forum.com/t/check-if-server-is-alive-in-drb/113165/1 "2007-08-28T10:16:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [September 9, 2007, 11:45pm UTC](https://www.ruby-forum.com/t/check-if-server-is-alive-in-drb/113165/2 "2007-09-09T23:45:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [September 10, 2007, 2:09am UTC](https://www.ruby-forum.com/t/check-if-server-is-alive-in-drb/113165/3 "2007-09-10T02:09:31Z")

</div>

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://drawohara.com/](http://drawohara.com/)

---

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [September 10, 2007, 8:28am UTC](https://www.ruby-forum.com/t/check-if-server-is-alive-in-drb/113165/4 "2007-09-10T08:28:03Z")

</div>

ara.t.howard wrote:

> 

hmm that’s good idea for keeping connections alive i guess 🙂 i had  
problems that frequent requests over ssl were making huge overhead.
