Daniel Rychlik wrote:

> Thanks,
> 
> I will try this out.  I hope it works in a multithreaded environment...

There is no alarm function on Win32, so if you're on UNIX you'll be
fine.  IO::Socket used to use alarm and was modified to use select
for that reason.

> try perldoc -f alarm
> 
> El Lunes, 1 de Mayo de 2006 21:05, Daniel Rychlik escribió:
> 
>>Guys,
>>
>>How would you set a timeout on a TCP connection?
>>
>>I have been playing with the idea of using IO::Socket to execute
>>commands on remote machines.
>>
>>On the listening side of the connection, I respond back to the client
>>with an "OKAY" for the client to send its remote command to the
>>server...  But this brought up the question, what if I never get a
>>response back through the TCP connection?
>>
>>I saw this in the client constructor but Im not able to get it to
>>work....
>>
>>my $socket = IO::Socket::INET->new(PeerAddr     => $remote_host,
>>                                PeerPort        => $remote_port,
>>                                Proto           => "tcp",
>>                                Type            => SOCK_STREAM,
>>                                TimeOut         => 10)
>>
>>
>>If the timeout limit is reached, with the client terminate?
>>
>>Is the value of TimeOut in the constructor stating "TimeOut is 10
>>seconds?"
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to