muto has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Socket; $remote = $ARGV[0]; $port = 80; if($port =~ /\D/) { $port = getservbyname($port, 'tcp') } die "no port specified" unless $port; $iaddr = inet_aton($remote) || die "$remote"; $paddr = sockaddr_in($port, $iaddr); $proto = getprotobyname('tcp'); socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "cannot open socket +: $!"; setsockopt (SOCK,IPPROTO_IP,IP_TTL,1); connect(SOCK, $paddr) || die "cannot connect to $remote: $!"; close(SOCK);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket TTL?
by monarch (Priest) on May 30, 2008 at 12:13 UTC | |
|
Re: IO::Socket TTL?
by Anonymous Monk on May 31, 2008 at 07:52 UTC | |
by Anonymous Monk on May 31, 2008 at 10:11 UTC |