On 26.03.2008 17:34, I=F1aki Baz Castillo wrote:
> Hi, which is the most efficient way of receiving and processing data
> from a network socket?
>=20
> I use GServer in this common way:
>=20
> --------------
> class MyServer < GServer
>     def serve(io)
>         loop do
>               if IO.select([io], nil, nil)
>                   ....
> --------------
>=20
> A "top" says to me that Ruby is eating more than 90% of CPU and there
> is no connections yet... :(
> Any other suggestion?
>=20
> Really thanks a lot.

Why don't you simply use blocking IO?

	robert