in reply to IO:: SOCKET Check Port, Please Help!

Use bind() function , hope it solves your requirement

  • Comment on Re: IO:: SOCKET Check Port, Please Help!

Replies are listed 'Best First'.
Re^2: IO:: SOCKET Check Port, Please Help!
by rizcotech (Initiate) on Sep 22, 2011 at 10:28 UTC

    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?