--sMkrXc3gAYLRVOjR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Chris Morris (chrismo / clabs.org) wrote:

> Chris Morris wrote:
> 
> >I replaced the Borges/WEBrick.rb code with localhost and it gets past 
> >getaddrinfo, but then fails on the TCPServer.new line:
> 
> I'm guessing this is older Borges code with newer WEBrick code. This is 
> the failing Borges code:
> 
>    server = WEBrick::HTTPServer.new(options)
>    server.listen('127.0.0.1', 7000) 
>    server.mount("/borges", self, options)
> 
> The HTTPServer.new call itself sets up shop on TCP port 7000, so the 
> following listen call is failing because the port is already in use. 
> Remmed out the .listen line and now we're rolling.

See alpha3, which does this the right way:
http://segment7.net/ruby-code/borges/Borges-1.0.0-alpha3.tar.gz

For reference, the correct way to set up a v4/v6 WEBrick server that
works out of the box on v4-only hosts is this:

def create(options)
  options[:BindAddress] ||= nil
  options[:Port] ||= 7000

  server = WEBrick::HTTPServer.new(options)

  return server
end

When the :BindAddress option is set to nil, getaddrinfo will
return both :: and 0.0.0.0 on an IPv6 system, and the server will bind
to both.

:: is kinda but not really an IPv6 equivalent to 0.0.0.0 (there are
several broadcast addresses for IPv6, depending upon who you want
to talk to).

-- 
Eric Hodel - drbrain / segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04


--sMkrXc3gAYLRVOjR
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE/6T+pMypVHHlsnwQRApdtAKCbTj3pkiRi7QngN4tyEqEoadZilACghcyz
jWv18raH4hlAbAWr2FnVd9o
Q5
-----END PGP SIGNATURE-----

--sMkrXc3gAYLRVOjR--