From: Ben Schumacher Date: 2002-09-17T20:43:47+09:00 Subject: A Windows issue with Kernel#select... I'm working on a Class that I'd like to be able to use on both Windows and *nix, but am having problems getting the desired behavior out of Windows. Currently, I'm using the native win32 version of Ruby which gives this output from 'ruby -v': ruby 1.6.7 (2002-03-01) [i586-mswin32] I first create a socket: s = TCPSocket.new('localhost', '5222') Then I use Kernel#select to monitor the socket for new input: x = select([s], nil, nil, 30) puts x.inspect In *nix (FreeBSD) when there is data waiting on the socket, I get the results, namely an array with my socket: [[#], [], []] However, on Windows, I'm getting an empty array: [[], [], []] As near as I can tell, the select is returnning at the right time... I tested this by opening the socket, dumping the current time, sending an event at roughly 5 seconds from the server, then dumping out the time select returned with the output. select returns with the array at ~5 seconds, which is far below the expiration which is set at 30 seconds, but the array comes back empty. Any clues? Since my Class will eventually need to be able to handle multiple sockets, this behavior just won't fly. I will need to know which sockets have data available. Thanks in advance. Cheers, bs.