in reply to Trying to use a socket to monitor an Ethernet port
The problem is that you're specifying a PeerAddr (client socket) and Listen (server socket). Drop Listen and accept.
use IO::Socket::INET (); my $sock = IO::Socket::INET->new( Proto => 'tcp', PeerAddr => '141.121.85.63', PeerPort => '64511', ) or die "Unable to create socket: $!\n"; print while <$sock>;
By the way, when on PerlMonks, please put your code, messages, etc inside of <c>...</c> tags. Please edit your post to spare a janitor the task.
|
|---|