[Mongrel] [Patch] HttpServer.port reports the bound port

Steven Lumos steven at lumos.us
Mon Aug 6 17:42:01 EDT 2007

"Zed A. Shaw" <zedshaw at zedshaw.com> writes:

> On Sun, 5 Aug 2007 17:02:12 -0700
> Corey Jewett <ml at syntheticplayground.com> wrote:
>> This is for when you pass mongrel 0 for the port and the OS assigns  
>> an open one.
>> Corey
> Does that work on Windows?  :-)  (Gets them every time.)

Well, they just ripped off Berkeley sockets, right?

This is v1.8.2 of the one-click installer.  I'll bother to update it
if anyone thinks it matters.

irb(main):001:0> require 'socket'
=> true
irb(main):002:0> s = TCPServer.new(0)
=> #<TCPServer:0x2dc4930>
irb(main):003:0> s.addr
=> ["AF_INET", 1110, "", ""]


More information about the Mongrel-users mailing list