From: nobu.nokada@... Date: 2002-05-14T09:09:54+09:00 Subject: Re: BUG! Platform independent? sockets and select Hi, At Tue, 14 May 2002 00:48:49 +0900, Kontra, Gergely wrote: > If I remove Tk.mainloop at the end, the server works on windows98! So > I'm afraid select and Tk's event loop don't like each other under > windows (at least when using sockets :)) Hmmm, without Tk.mainloop your server.rb will stop at `gets' line. It doesn't block? I guess it's caused by that socket descriptor is duplicated but socket handle isn't in win32/win32.c:myfddup() called from ext/socket/socket.c:sock_new(). Since 1.7 doesn't use this myfddup(), the problem doesn't occur. It seems to be fixed by following provisional patch. Index: socket.c =================================================================== RCS file: /cvs/ruby/src/ruby/ext/socket/socket.c,v retrieving revision 1.35.2.11 diff -u -2 -p -r1.35.2.11 socket.c --- ext/socket/socket.c 2002/03/25 06:16:02 1.35.2.11 +++ ext/socket/socket.c 2002/05/13 09:54:22 @@ -183,8 +183,6 @@ sock_new(class, fd) #ifdef NT fp->finalize = sock_finalize; - fd = myfddup(fd); -#else - fd = dup(fd); #endif + fd = dup(fd); fp->f2 = rb_fdopen(fd, "w"); fp->mode = FMODE_READWRITE; -- Nobu Nakada