On Wed, Jun 5, 2019 at 12:10 AM Kurtis Rader <kra...@skepticism.us> wrote:
>
> On Tue, Jun 4, 2019 at 11:53 PM Inada Naoki <songofaca...@gmail.com> wrote:
>>
>> conn.SetReadDeadline(time.Now())
>
>
> Did you test that solution? Setting a deadline only affects "future Read 
> calls" according to the documentation. It cannot be used to timeout an extant 
> read. Which is what I would expect given the available UNIX like kernel APIs. 
> So while I have not tested this using a program written in Go I would not 
> expect it to work and the equivalent solution definitely does not work in 
> other languages I use regularly.

No, this does in fact work in Go.  I should have thought of that.  The
docs say, correctly, "SetReadDeadline sets the deadline for future
Read calls and any currently-blocked Read call."

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUGSgQC8Z3stktpYkmhiRhvAfG09va1jM0q7_p4-K9Rzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to