firecat
firecat

Reputation: 113

perl6 io::socket::inet how to set timeout for socket?

my $c = IO::Socket::INET.new(:host<localhost>, :port(80));
$c.print: 'Test';
say $c.recv;

how can i set timeout for IO::Socket::INET recv?

Upvotes: 4

Views: 237

Answers (1)

raiph
raiph

Reputation: 32464

See the timeout example in the Promise.anyof doc.

(See also Concurrent::Progress for the more general case of tracking progress.)

Upvotes: 4

Related Questions