From: Eric Hodel Date: 2006-12-21T12:27:49+09:00 Subject: Re: why is gethostbyname in TCPSocket? On Dec 20, 2006, at 18:00, msoulier wrote: > Looking for dns support, I found the gethostbyname method as a class > method of TCPSocket in the socket library. $ ruby -rsocket -e 'p TCPSocket.ancestors' [TCPSocket, IPSocket, BasicSocket, IO, File::Constants, Enumerable, Object, Kernel] > Seems like an odd place, considering that gethostbyname is hardly > specific to TCP protocol alone. > > Any idea why it was put there? It wasn't. $ ruby -rsocket -e 'p Socket.gethostbyname("localhost")' ["localhost", [], 30, "\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\001"] -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net I LIT YOUR GEM ON FIRE!