Re: IO::Socket::INET timeout?

2024-01-21 Thread Paul Procacci
On Sat, Jan 20, 2024 at 5:02 PM William Michels 
wrote:

> Hi Paul,
>
> Did you get any resolution on this? I've only found these links:
>
> https://docs.raku.org/type/IO/Socket/INET
>
>
> https://stackoverflow.com/questions/72639883/how-to-deal-with-exceptions-in-iosocketinet
>
> I imagine a solution is possible using a Supply, but I haven't gotten
> there yet:
>
> https://docs.raku.org/type/Supply
>
> Best, Bill.
>
>
> On Jan 8, 2024, at 18:06, Paul Procacci  wrote:
>
> 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
>
>
> --
> __
>
> :(){ :|:& };:
>
>
>
Hey William,

I haven't made any progress.  I have enough things going on that I can
afford to put it aside for a while and then circle back to this in a bit.
If you find out, please let us know!  I too think Supply is the way forward
here.

~Paul
-- 
__

:(){ :|:& };:


Re: IO::Socket::INET timeout?

2024-01-20 Thread William Michels via perl6-users
Hi Paul,

Did you get any resolution on this? I've only found these links:

https://docs.raku.org/type/IO/Socket/INET

https://stackoverflow.com/questions/72639883/how-to-deal-with-exceptions-in-iosocketinet

I imagine a solution is possible using a Supply, but I haven't gotten there yet:

https://docs.raku.org/type/Supply

Best, Bill.


> On Jan 8, 2024, at 18:06, Paul Procacci  wrote:
> 
> 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
> 
> 
> -- 
> __
> 
> :(){ :|:& };: