From: Mike Stok Date: 2001-11-30T18:27:52+09:00 Subject: [ruby-talk:27044] Re: How to get IP address of client from server On Fri, 30 Nov 2001, Harry Ohlsen wrote: > If I have something like the following ... > > server = TCPServer.new("0.0.0.0", 1234) > > while (session = server.accept()) != nil > puts session.addr > end > > It always shows me the server end IP address. Is it possible to find out > the address of the client that initiated the connection? Does session.peeraddr do what you want? Hope this helps, Mike -- mike@stok.co.uk | The "`Stok' disclaimers" apply. http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA mike@starnix.com | Fingerprint 0570 71CD 6790 7C28 3D60 http://www.starnix.com/ | 75D2 9EC4 C1C0 0599 13DA