XComms has asked for the wisdom of the Perl Monks concerning the following question:
This is the code.
#!/usr/bin/perl -w $IP_Addr = "ss6"; #$TCP_port = (1025); print "Enter start TSG port: "; chomp ($TCP_port = <stdin>); print "Enter last TSG port: "; chomp ($last_TSG = <stdin>); use IO::Socket; while ($TCP_port <= $last_TSG) { open_TSG ($IP_Addr, $TCP_port); $TCP_port +=1 ; } sub open_TSG { # use IO::Socket; $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $IP_Addr, PeerPort => $TCP_port, ) or die "Cannot conect to port $TCP_port at $IP_Addr"; $response = <$remote>; print "$TCP_port active\n"; print $remote "g\n"; } while ( <$remote> ) {print </dev/null> }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO socket closed when new one is opened.
by Fletch (Bishop) on Jan 06, 2005 at 17:50 UTC | |
|
Re: IO socket closed when new one is opened.
by revdiablo (Prior) on Jan 06, 2005 at 18:30 UTC | |
|
Re: IO socket closed when new one is opened.
by BUU (Prior) on Jan 06, 2005 at 23:43 UTC |