Hi All
I am getting an error when using the below code
Receiver
use IO::Socket;
$sock = new IO::Socket::INET (LocalHost => 'goldengate',
LocalPort => 1200,
Proto => 'tcp',
Listen => 5,
Reuse => 1
);
die "Socket could not be created. Reason: $!" unless $sock;
while ($new_sock = $sock->accept()) {
while (defined ($buf = <$new_sock>)) {
print $buf;
}
}
close ($sock);
Sender
use IO::Socket;
$sock = new IO::Socket::INET (PeerAddr => 'goldengate',
PeerPort => 1200,
Proto => 'tcp',
);
die "Socket could not be created. Reason: $!\n" unless $sock;
foreach (1 .. 10) {
print $sock "Msg $_: How are you?\n";
}
close ($sock);
The Error is Socket could not be created.
Please provide the remediation for this..