From: kazaam Date: 2007-10-07T01:50:03+09:00 Subject: Can I do this perl code the same in ruby? Well I'm trying to "translate" a perl program to ruby and everything worked fine until the near end where I'm now. There we have this perl code: my $slct = IO::Select->new($server); while($slct->can_read()) { my $nbytes = read $server, $response, 2**16; last if !$nbytes; $client->send($response); } $server is a socket-handle exactly as $client. But now I'm stuck. Is there any equivalent to perls can_read ? Than this line here: my $nbytes = read $server, $response, 2**16; last if !$nbytes; Means something like read from server 2^16 bytes save to nbytes and append to response or? -- kazaam