CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Sockets again - gathering connected host IP

 



putrycydes
New User

Apr 22, 2008, 9:57 AM

Post #1 of 2 (307 views)
Sockets again - gathering connected host IP Can't Post

Hi everyone. I've got a question. I'm rather perl beginner (intermediate is maximum), working on simple server-client PERL application, and I am testing it on the same machine. Let's say there is a server listening for connection.Now: client is connecting. How can I check what's client's IP ? I know I could use socket->peerhost, but the value is 127.0.0.1 and I want "real" IP, such as when I'm running ifconfig ( for example 192.168.198.140 ). Anyone could help me ? Thanks in advance.


zOrK
Novice

Apr 23, 2008, 4:26 PM

Post #2 of 2 (300 views)
Re: [putrycydes] Sockets again - gathering connected host IP [In reply to] Can't Post


Code
 my $host = gethostbyaddr($socket->peeraddr, AF_INET);

wouldn't work, right?

---------

You may also find Perl information on my blog: http://www.ferry.cl/carlos/

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives