[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Obtaining ip address of client socket in ruby

Victor Rosillo

11/24/2007 3:38:00 PM

How can I obtain the ip address of the originating (client) socket ,
in a server/client socket ruby program?

What ruby library is fitted with a class/ method to do this?
How can it be done using ruby?

I would appreciate some sample code.



5 Answers

Robert Klemme

11/24/2007 4:01:00 PM

0

2007/11/24, Victor Rosillo <victorrosillo@gmail.com>:
> How can I obtain the ip address of the originating (client) socket ,
> in a server/client socket ruby program?
>
> What ruby library is fitted with a class/ method to do this?
> How can it be done using ruby?
>
> I would appreciate some sample code.

http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_ne...

robert

--
use.inject do |as, often| as.you_can - without end

Bill Kelly

11/24/2007 5:35:00 PM

0


From: "Robert Klemme" <shortcutter@googlemail.com>
> 2007/11/24, Victor Rosillo <victorrosillo@gmail.com>:
>> How can I obtain the ip address of the originating (client) socket ,
>> in a server/client socket ruby program?
>>
>> What ruby library is fitted with a class/ method to do this?
>> How can it be done using ruby?
>>
>> I would appreciate some sample code.
>
> http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_ne...


sock_domain, remote_port, remote_hostname, remote_ip = socket.peeraddr


# note: sock_domain is the address family, e.g. "AF_INET"


Regards,

Bill




China Blue Veins

11/3/2013 1:56:00 AM

0

In article <atropos-CA6607.11482902112013@news-europe.giganews.com>,
BTR1701 <atropos@mac.com> wrote:

> Democracy will cease to exist when you take away from those who are
> willing to work and give to those who would not.
>
> --Thomas Jefferson

How did he feel about slaves who were forced to work willing or no?
--
Guajira Guantanamera: Hell hath no fury like a nation scorned.
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted.
CIA Constitution patriot terrorism freedom Snowden
Paid Maternity Leave NSA fodder Dirty Dozen 2 Bomb

Thanatos

11/3/2013 4:02:00 AM

0

In article
<chine.bleu-A80AB4.18561502112013@news.eternal-september.org>,
Siri Cruz <chine.bleu@yahoo.com> wrote:

> In article <atropos-CA6607.11482902112013@news-europe.giganews.com>,
> BTR1701 <atropos@mac.com> wrote:
>
> > Democracy will cease to exist when you take away from those who are
> > willing to work and give to those who would not.
> >
> > --Thomas Jefferson
>
> How did he feel about slaves who were forced to work willing or no?

Crack a book and find out. I swear to god, Usenet is full of the laziest
people...

Dano

11/3/2013 6:05:00 AM

0

"Siri Cruz" wrote in message
news:chine.bleu-A80AB4.18561502112013@news.eternal-september.org...

In article <atropos-CA6607.11482902112013@news-europe.giganews.com>,
BTR1701 <atropos@mac.com> wrote:

> Democracy will cease to exist when you take away from those who are
> willing to work and give to those who would not.
>
> --Thomas Jefferson

How did he feel about slaves who were forced to work willing or no?
--
=============================================

He and the other Founding "Fathers" didn't think the womenfolk counted in a
democracy either. Hypocrisy wasn't created just yesterday.