From: mfuhr@... (Michael Fuhr) Date: 2004-12-20T13:07:07+09:00 Subject: Re: Reverse of Socket::getservbyname? Aquila 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/