Hi,

At Tue, 7 Sep 2004 00:47:09 +0900,
Henrik Warne wrote in [ruby-talk:111654]:
> There is no contact with 10.2.20.250:80, and I want the connect call to
> return immediately with EINPROGRESS (or similar), so I can use select to
> decide how long to wait before giving up (I haven't added the code to do
> that since I can't get the connect to return immediately).

Does this patch help?


Index: ext/socket/socket.c =================================================================== RCS file: /cvs/ruby/src/ruby/ext/socket/socket.c,v retrieving revision 1.127 diff -U2 -p -d -r1.127 socket.c --- ext/socket/socket.c 7 Sep 2004 03:52:14 -0000 1.127 +++ ext/socket/socket.c 7 Sep 2004 06:17:49 -0000 @@ -856,5 +856,7 @@ ruby_connect(fd, sockaddr, len, socks) { int status; +#if defined(HAVE_FCNTL) int mode; +#endif #if WAIT_IN_PROGRESS > 0 int wait_in_progress = -1; @@ -899,4 +901,7 @@ ruby_connect(fd, sockaddr, len, socks) #ifdef EINPROGRESS case EINPROGRESS: +#endif +#if defined(HAVE_FCNTL) + if (mode & NONBLOCKING) break; #endif #if WAIT_IN_PROGRESS > 0
-- Nobu Nakada