Ip address of client from GServer#serve


#1

Hi,

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

Regards,

Julien


#2

Julien B. 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


#3

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).