Aquila <braempje / netscape.net> writes:

> Is there a way to resolve ports by using some method of Socket?
> I could parse /etc/services but I'd rather like to use existing methods...

The C function is getservbyport() but I don't see it implemented
in Socket, at least not in Ruby 1.8.2.  Socket.getnameinfo appears
to work:

irb(main):002:0> Socket.getnameinfo([nil, 80, nil])
=> ["localhost", "http"]

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/