Hi all, am trying to interacting with a server.I should get a response from the server when i will send a command.
But there is a chance where i wont get response sometimes.
In my code the recv function will get the response wen the server sends, but if there is no response then recv will hangout and will wait till the response come...i want it to wait for sometime and should comeout...
Here is my code....
$socket = new IO::Socket::INET (
PeerAddr => '$IP',
PeerPort => 3575,
Proto => 'tcp',
or die "Couldn't connect to Server\n";
$send_data = "CHK $ARGV";
print STDERR "\nSEND( TYPE q or Q to Quit):$send_data\n";
if ($send_data ne 'q' and $send_data ne 'Q')
print "RECIEVED: $recv_data2\n";
20090213 Janitored by Corion: Closed code tag, as per Writeup Formatting Tips