Access IP address in POE::Component::Client::HTTP

[email protected] ("Doreen Grey") Wed, 27 Jan 2010 17:02:14 +0100
Newsgroups perl.poe
Message-ID <[email protected]>
Hello all,

I've built a web client application with POE::Component::Client::HTTP. I followed the examples in the cookbook (http://poe.perl.org/?POE_Cookbook/Web_Client) and everything works fine.

In my 'got_response' function I need to process the IP address of the host this response came from. Let's say the $response->uri is http://poe.perl.org, then I'll need the IP address 67.207.145.70 of that host.

Of course I could do an additional lookup of that host:
  DB<11> print inet_ntoa(inet_aton('poe.perl.org'))
67.207.145.70

But because POE has already resolved this name, why should I have to do it again. So, is there a way to access the remote IP address in the 'got_response' function?

Thanks for your help!
Doreen
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser