Ip address of client from GServer#serve

Hi,

I would like to know if there is a way to take the ip address of client from GServer#serve.

Regards,

Julien

Julien Biard wrote:

I would like to know if there is a way to take the ip address of client
from GServer#serve.

Try this:

def serve(myClient)
  p myClient.peeraddr
end

···

--
Posted via http://www.ruby-forum.com/\.

thanks, it works.
I should have considered the GServer#serve parameter as a socket and not
just as an io (cf http://www.ruby-doc.org/core/classes/GServer.html\).

···

On Mon, Jan 19, 2009 at 3:43 PM, Brian Candler <b.candler@pobox.com> wrote:

Julien Biard wrote:
> I would like to know if there is a way to take the ip address of client
> from GServer#serve.

Try this:

def serve(myClient)
p myClient.peeraddr
end
--
Posted via http://www.ruby-forum.com/\.