[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Is GServer the best to use?

Michael Furmaniuk

3/4/2009 11:09:00 PM

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 Ruby 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
--
Posted via http://www.ruby-....

5 Answers

Iñaki Baz Castillo

3/4/2009 11:12:00 PM

0

El Jueves, 5 de Marzo de 2009, Michael Furmaniuk escribi=C3=B3:
> 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 Ruby 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.

GServer is in fact appropiate for that.


=2D-=20
I=C3=B1aki Baz Castillo

Justin Collins

3/4/2009 11:46:00 PM

0

Iñaki Baz Castillo wrote:
> El Jueves, 5 de Marzo de 2009, Michael Furmaniuk escribió:
>
>> 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 Ruby 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.
>>
>
> 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://rubyeventma...

Iñaki Baz Castillo

3/4/2009 11:52:00 PM

0

El Jueves, 5 de Marzo de 2009, Justin Collins escribi=C3=B3:
> 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.=
=20
This can be better or worse for you, depending on your requeriments.

=2D-=20
I=C3=B1aki Baz Castillo

Eleanor McHugh

3/4/2009 11:54:00 PM

0

On 4 Mar 2009, at 23:46, Justin Collins wrote:
> I=F1aki Baz Castillo wrote:
>> El Jueves, 5 de Marzo de 2009, Michael Furmaniuk escribi=F3:
>>
>>> I am in need of a TCP Server, basically something multithreaded =20
>>> 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 Ruby book, but when I looked around for some more
>>> information I saw the references to GServer. Is this the best one =20=

>>> 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 =20=

>>> to the
>>> Server with information of system status, or scripts that were run =20=

>>> 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 =20=

>>> 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 =20
> well.
> If, for some reason, that ends up not being able to handle all the =20
> connections, then use Eventmachine[1].

You can find code examples covering GServer, EventMachine and various =20=

other bits of Ruby networking in the presentations link to in my =20
signature. At some point I'll put them online properly as it seems a =20
lot of people have an interest in this stuff :)


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-...
----
raise ArgumentError unless @reality.responds_to? :reason



Michael Furmaniuk

3/5/2009 12:53:00 PM

0

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
--
Posted via http://www.ruby-....