This is my code:
my $server_socket = new IO::Socket::INET
(
LocalPort => 8378,
Type => SOCK_STREAM,
Listen => $SOMAXCONN,
Proto => 'tcp',
Reuse => 1
) || die "$!\n";
$serverName = $ENV{COMPUTERNAME};
$socketPortNr = 8378;
$clientSocket = new IO::Socket::INET (PeerAddr => $serverName,
PeerPort => $socketPortNr,
Proto => 'tcp');
but the $clientSocket is empty.
What could be the reason for empty $clientSocket?
use warningsanduse strictin your code.my $sock = IO::Socket::INET->new(...) or die $!. The$!will tell you what's wrong