From: "Hal E. Fulton" Date: 2001-09-25T13:09:38+09:00 Subject: [ruby-talk:21654] IPSocket#addr I'm seeing some behavior that is (to me) unexpected. I want to find the IP name at the other end of a socket (I'm on the server side). I'm using gets and puts for simplicity -- not using recvfrom, so I can't use the extra info it returns (unless I change my code). Thought I would use #addr, since it returns this info. I looked in The Book, and it says: u = UDPSocket.new u.bind('localhost', 8765) u.addr � ["AF_INET", 8765, "localhost", "127.0.0.1"] BasicSocket.do_not_reverse_lookup = true u.addr � ["AF_INET", 8765, "127.0.0.1", "127.0.0.1"] This is under IPSocket (from which TCPSocket inherits). Problem is, it always seems to give me an address, not a name. Noting the example above, I thought, "Well, maybe that Boolean value doesn't default to false." So I set it to false. But it hangs! I wasn't sure whether I should actually use BasicSocket or use the object -- tried it both ways, and it just hangs. Ideas?? Hal