From: Ryo HAYASAKA Date: 2001-12-17T09:22:52+09:00 Subject: [ruby-dev:15466] listen for sockets in both IPv4 and IPv6 早坂@北陸先端です. IPv4 と IPv6 の両方のコネクションを受け付けるようにするには, 以下の ように変更するとよいと思うのですがいかがでしょう? load_addr_info() 内で res 作るところで PF_UNSPEC 指定してますし, 両 方受け付けるのが正しいと思うのです. # それとも, 意図的に 882 行目で break してるのかな? 現状では IPv6 の方のみ LISTEN します. (ruby 1.7.2 (2001-12-13) [i386-netbsdelf]) Index: socket.c =================================================================== RCS file: /src/ruby/ext/socket/socket.c,v retrieving revision 1.58 diff -u -r1.58 socket.c --- socket.c 2001/10/29 05:07:20 1.58 +++ socket.c 2001/12/16 23:40:22 @@ -878,8 +878,10 @@ #endif fd = -1; continue; - } else - break; + } + if (type == INET_SERVER) + listen(fd, 5); + } if (status < 0) { if (fd >= 0) @@ -894,9 +896,6 @@ } rb_sys_fail(syscall); } - - if (type == INET_SERVER) - listen(fd, 5); /* create new instance */ if (res_local) -- HAYASAKA, Ryo (早坂 良) mailto:ryoh@jaist.ac.jp http://www.jaist.ac.jp/%7Eryoh/ Japan Advanced Institute of Science and Technology (JAIST)