Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use CGI; use IO::Socket; my $clientIP = $params{'HostName'}; my $clientPort = $params{'Port'}; my $client = undef; my $timeOut = 10; my $reqString = $params{'RequestString'}; my $resString = ""; $client = IO::Socket::INET->new ( PeerAddr => $clientIP, PeerPort => $clientPort, Proto => "tcp", Type => SOCK_STREAM, Timeout => $timeOut ); # Send the request (appended with a newline character) to the sock +et print $client $reqString."\n"; # Retrieve the response from the socket buffer $resString = <$client>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Implementing Sockets Timeouts
by DigitalKitty (Parson) on Aug 02, 2002 at 02:39 UTC | |
by Anonymous Monk on Aug 02, 2002 at 08:52 UTC |