[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ip address of client from GServer#serve

Julien Biard

1/19/2009 2:09:00 PM

Hi,

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

Regards,

Julien

2 Answers

Brian Candler

1/19/2009 2:43:00 PM

0

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

Julien Biard

1/19/2009 3:00:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

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


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