IO::Socket::INET timeout?

[email protected] (Paul Procacci)
Newsgroups perl.perl6.users
Message-ID <CAFbbPuh28huO8z8GBXTRvcMHnrZSA96qqp3j7RMGm6mHM11Rig@mail.gmail.com>
 Hey all,

What's the right way to specify a timeout for an IO::Socket::INET?

What I have:
$!socket := IO::Socket::INET.new(:host($!server), :port($!port));

What I'd like to do which isn't possible:
$!socket := IO::Socket::INET.new(:host($!server), :port($!port),
:timeout($!timeout);

Can your suggestion apply to reads/writes as well?
To further this, I've reading on Promises and Supply's and have found
suggestions that only Supply's can capture errors and whatnot, etc.

I'm not sure what to make if anything I've read.  Does anyone have a clear
example of connecting a socket, and reading/writing to that socket with
timeouts?

Thanks,
Paul Procacci


-- 
__________________

:(){ :|:& };:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.