Issue #7100 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to akr (Akira Tanaka)
Target version set to 2.0.0

akr ???????????????????????障?????鐚?

-- 
Yusuke Endoh <mame / tsg.ne.jp>
----------------------------------------
Bug #7100: WEBrick::HTTPServer.new ??? BindAddress ??????絎??????????翫?????????茘?????荐???蚊????????
https://bugs.ruby-lang.org/issues/7100#change-32403

Author: sho-h (Sho Hashimoto)
Status: Assigned
Priority: Low
Assignee: akr (Akira Tanaka)
Category: 
Target version: 2.0.0
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


=begin
篁ヤ???????????????????????茘?????荐???蚊????????????????с?????

  $ ruby -v -r webrick -e 'WEBrick::HTTPServer.new(Port: 3000)'
  ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
  [2012-09-04 19:20:48] INFO  WEBrick 1.3.1
  [2012-09-04 19:20:48] INFO  ruby 1.9.3 (2012-04-20) [x86_64-linux]
  [2012-09-04 19:20:48] WARN  TCPServer Error: Address already in use - bind(2)

1.8 ??с?????蚊???????障???????с????????1.9.1 篁ラ????????蚊???????障????????

lib/webrick/utils.rb ??? WEBrick::Utils#create_listeners ???篁ヤ?????????????c?????????

  res = Socket::getaddrinfo(address, port,
                            Socket::AF_UNSPEC,   # address family
                            Socket::SOCK_STREAM, # socket type
                            0,                   # protocol
                            Socket::AI_PASSIVE)  # flag
  last_error = nil
  sockets = []
  res.each{|ai|
    begin
      logger.debug("TCPServer.new(#{ai[3]}, #{port})") if logger
      sock = TCPServer.new(ai[3], port)
      ...

Socket.getaddrinfo ??? 1.9 ??????茲???医?ゃ??菴???????????????????с?????1.8.7 ?????? 0.0.0.0 ???鴻???????с????????

  $ ruby -v -r pp -r socket -e 'pp Socket::getaddrinfo(nil, 3000, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)'
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
  [["AF_INET", 3000, "0.0.0.0", "0.0.0.0", 2, 1, 6],
   ["AF_INET6", 3000, "::", "::", 10, 1, 6]]

WEBrick::Utils#create_listeners ???潟?<?潟???????????????????????????<??????????????????с????????config[:BindAddress] ??????????????ゃ?? 0.0.0.0 ??? :: ????<???????????????障???????????????с???????????
=end



-- 
http://bugs.ruby-lang.org/