This is a client side script, not server... here is the code I currently have:
##
# Connect to report host
###
my $sock = new IO::Socket::INET ( PeerAddr => $rpt_host,
PeerPort => $rpt_port,
Proto => 'tcp'
)||
die &printError($!,"NULL");
$sock->autoflush(1);
#
# Send data to host
#
print $sock $rpt_params || die &printError($!,"Sending: ".$rpt_params)
+;
#
# Get response from host. First 4 bytes returned in header tells leng
+th of rest of message.
#
$msg = <$sock> || die &printError($!,"Recv: ".<$sock>);
close($sock);
How would your suggestion help? |