Setting timeout on socket calls 
Author Message
 Setting timeout on socket calls

When connecting to a terminal server using a socket object, I set the
timeout value to 10. The documention doesn't state the units of time but
I presume it's in seconds. The documents further states that the timeout
is used for "some" operations.
The problem is that if the serial device is not connected to the
terminal server the script hangs on the : "
$socket->recv($response,10);" I create the socket as listed below:

      $socket = IO::Socket::INET->new(PeerAddr => $hostname,
       PeerPort => $remote_port,
       Proto    => "tcp",
       type     => SOCK_STREAM,
       timeout  => 10);

 I send the command to the terminal server ethernet socket, the terminal
server will
send the command out the appropriate serial port. The recv command is
wait for
a response back from the serial port via network socket, but it just
hangs.


     print "Wait for response, command sent";
    $socket->recv($response,10);
     print "I never get to here";




Fri, 18 Oct 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Raw beginner - needing help or clarification

2. Setting timeout with IO::Socket

3. Socket on NT and timeout settings

4. Setting timeout on socket read?

5. Setting timeout for socket

6. IO::Socket::INET - Timeout for Reading or a Methode to get the Socket Status back

7. Strange problem in DBGride use TQuery link to Oracle !!!

8. convert LS 4.0 info to Pascal

9. How to set timeout in Perl?

10. How to set keyboard timeout

11. Setting timeout?

12. Handling Net::FTP (Socket) timeouts

 

 
Powered by phpBB® Forum Software