Ok, runing the script mentioned there too didnt do much... Do I need some special hardware for this to work or what? When I run:
use strict; use warnings; #use diagnostics; use lib "."; use Net::UPnP::ControlPoint; use Net::UPnP::GW::Gateway; my $obj = Net::UPnP::ControlPoint->new(); my $retry_cnt = 0; my @dev_list = (); while (@dev_list <= 0 || $retry_cnt > 5) { #@dev_list = $obj->search(st =>'urn:schemas-upnp-org:device:Intern +etGatewayDevice:1', mx => 10); @dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3); $retry_cnt++; print Dumper(@dev_list); } my $devNum = 0; foreach my $dev (@dev_list) { my $device_type = $dev->getdevicetype(); if ($device_type ne 'urn:schemas-upnp-org:device:InternetGatewayD +evice:1') { next; } print "[$devNum] : " . $dev->getfriendlyname() . "\n"; unless ($dev->getservicebyname('urn:schemas-upnp-org:service:WANIP +Connection:1')) { next; } my $gwdev = Net::UPnP::GW::Gateway->new(); $gwdev->setdevice($dev); print "\tExternalIPAddress = " . $gwdev->getexternalipaddress() . +"\n"; print "\tPortMappingNumberOfEntries = " . $gwdev->getportmappingnu +mberofentries() . "\n"; my @port_mapping = $gwdev->getportmappingentry(); my $port_num = 0; foreach my $port_entry (@port_mapping) { if ($port_entry) { my $port_map_name = $port_entry->{'NewPortMappingDescripti +on'}; if (length($port_map_name) <= 0) { $port_map_name = "(No name)"; } print " [$port_num] : $port_map_name\n"; foreach my $name ( keys %{$port_entry} ) { print " $name = $port_entry->{$name}\n"; } } else { print " [$port_num] : Unknown\n"; } $port_num++; } }
the array @dev_list is empty... so, what am I missing here?

In reply to Re^4: A Simple Server/Client implementation by Ace128
in thread A Simple Server/Client implementation by Ace128

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.