# Is GServer the best to use?

**URL:** <https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025>\
**Category:** Ruby\
**Created:** [March 5, 2009, 12:10am UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025 "2009-03-05T00:10:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mifi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mifi](https://www.ruby-forum.com/u/mifi)\
**Post date:** [March 5, 2009, 12:10am UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025/1 "2009-03-05T00:10:48Z")

</div>

I am in need of a TCP Server, basically something multithreaded that I  
can use to pass through data to a database from clients that will  
connect to the Server. I started playing with an example from the  
O’Reilly Learning R. book, but when I looked around for some more  
information I saw the references to GServer. Is this the best one to  
use? Is there something else that I can use for TCP that anyone can  
recommend? My real need at this point is to have Clients connect to the  
Server with information of system status, or scripts that were run and  
their outputs, and put that in a database. So it doesn’t need to be  
complex, but I’d like it to be able to handle multiple clients and be  
able to keep a connection to the database, so there are not too many  
open sockets; kind of why I want a pass through.

Any recommendations would be appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![mifi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mifi](https://www.ruby-forum.com/u/mifi)\
**Post date:** [March 5, 2009, 12:14am UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025/2 "2009-03-05T00:14:40Z")

</div>

El Jueves, 5 de Marzo de 2009, Michael Furmaniuk escribiÃ³:

> able to keep a connection to the database, so there are not too many  
> open sockets; kind of why I want a pass through.
> 
> Any recommendations would be appreciated.

GServer is in fact appropiate for that.

---

<div class="post-metadata">

**Author:** ![mifi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mifi](https://www.ruby-forum.com/u/mifi)\
**Post date:** [March 5, 2009, 12:48am UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025/3 "2009-03-05T00:48:37Z")

</div>

IÃ±aki Baz C. wrote:

> > their outputs, and put that in a database. So it doesn’t need to be  
> > complex, but I’d like it to be able to handle multiple clients and be  
> > able to keep a connection to the database, so there are not too many  
> > open sockets; kind of why I want a pass through.
> > 
> > Any recommendations would be appreciated.
> 
> GServer is in fact appropiate for that.

I agree. Start off with GServer. It’s really easy to use and works well.  
If, for some reason, that ends up not being able to handle all the  
connections, then use Eventmachine[1].

-Justin

[1] [http://rubyeventmachine.com/](http://rubyeventmachine.com/)

---

<div class="post-metadata">

**Author:** ![mifi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mifi](https://www.ruby-forum.com/u/mifi)\
**Post date:** [March 5, 2009, 12:53am UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025/4 "2009-03-05T00:53:53Z")

</div>

El Jueves, 5 de Marzo de 2009, Justin C. escribiÃ³:

> I agree. Start off with GServer. It’s really easy to use and works well.  
> If, for some reason, that ends up not being able to handle all the  
> connections, then use Eventmachine[1].

But consider that EventMachine is not a threaded model, but a reactor  
one.  
This can be better or worse for you, depending on your requeriments.

---

<div class="post-metadata">

**Author:** ![mifi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mifi](https://www.ruby-forum.com/u/mifi)\
**Post date:** [March 5, 2009, 12:56am UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025/5 "2009-03-05T00:56:14Z")

</div>

On 4 Mar 2009, at 23:46, Justin C. wrote:

> > > recommend? My real need at this point is to have Clients connect
> > 
> > GServer is in fact appropiate for that.
> 
> I agree. Start off with GServer. It’s really easy to use and works  
> well.  
> If, for some reason, that ends up not being able to handle all the  
> connections, then use Eventmachine[1].

You can find code examples covering GServer, EventMachine and various  
other bits of Ruby networking in the presentations link to in my  
signature. At some point I’ll put them online properly as it seems a  
lot of people have an interest in this stuff 🙂

Ellie

## Eleanor McHugh Games With Brains [http://slides.games-with-brains.net](http://slides.games-with-brains.net)

raise ArgumentError unless @reality.responds\_to? :reason

---

<div class="post-metadata">

**Author:** ![mifi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mifi](https://www.ruby-forum.com/u/mifi)\
**Post date:** [March 5, 2009, 1:54pm UTC](https://www.ruby-forum.com/t/is-gserver-the-best-to-use/162025/6 "2009-03-05T13:54:33Z")

</div>

Eleanor McHugh wrote:

> You can find code examples covering GServer, EventMachine and various  
> other bits of Ruby networking in the presentations link to in my  
> signature. At some point I’ll put them online properly as it seems a  
> lot of people have an interest in this stuff 🙂

This would be great, I need an example sometimes to get me started in  
the right direction - probably my Perl background. I’ll check out the  
samples.

Thanks for the advice all, I appreciate it.

- Michael
