punungwe has asked for the wisdom of the Perl Monks concerning the following question:
I am using the following script
$sock = new IO::Socket::INET ( PeerAddr => $$display{'dp_ipaddress' +}, PeerPort => $$display{'dp_tcpport'}, Proto => 'tcp', Blocking => 1, Timeout => 3, ); # blah blah constructing $msg $sock->send($msg); $resp = <$sock>;
My problem....
The script is getting stuck at '$resp = <$sock>;'
My application, I am sending a message to an electronic display with a microcontroller, which should respond with an ACK (0x6), a NACK (0x15) or no response at all if the display is dead or cable is broken.
I use the response to update a database to indicate to user which displays are working. I have to iterate through many displays and I don't want to get stock at the first non-responding one.
Any ideas on how to get past this problem. I have tried the various eval...die suggestions and select options but none works. I am developing on Windows but product will be deployed on Linux.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting stuck reading from a socket
by zentara (Cardinal) on Jul 11, 2012 at 14:32 UTC | |
by punungwe (Initiate) on Jul 12, 2012 at 08:36 UTC | |
by punungwe (Initiate) on Jul 12, 2012 at 11:39 UTC | |
by zentara (Cardinal) on Jul 12, 2012 at 14:34 UTC | |
|
Re: Getting stuck reading from a socket
by jethro (Monsignor) on Jul 11, 2012 at 13:25 UTC | |
|
Re: Getting stuck reading from a socket
by punungwe (Initiate) on Jul 17, 2012 at 09:44 UTC |