From: Tom Felker Date: 2003-03-19T07:03:09+09:00 Subject: How to get the Windows handle for a socket On Windows, I do the following (trying to get a nonblocking socket): f=Win32API.new("ws2_32", "ioctlsocket", ["l", "l", "l"], 'i') s=TCPServer.new(15000) f.call(s.fileno, 2147772030, 1) #FIONBIO This returns 10038, "Not a socket," instead of 0, "Success." s.fileno is 3. On Windows, sockets are simply handles, which don't need to be low integers like 3, and usually aren't. What I need is to get the real handle to the socket. (Or any other way to set a socket nonblocking in Windows.) Also, a way to make TCPSocket.new not block would be nice. I'm trying to make a chat program, and it needs to stay responsive, so it uses the GUI toolkit's functions to register a callback when the socket is selected for. Thanks, -- Tom Felker "Proprietary standard" is an oxymoron.