Timeout : return an error compatible with os.IsTimeout()#118
Timeout : return an error compatible with os.IsTimeout()#118maitredede wants to merge 1 commit intobugst:masterfrom
Conversation
|
The actual behavior is "return 0 without error", that can also be understood as "end of stream". Network connections and file reads have their own timeout errors that can be detected with |
|
This is exactly the issue i'm running into. I'm using |
|
@maitredede do you have time to rebase this? |
There was a problem hiding this comment.
I think case Timeout:; return "Timeout" should also be added before default: (bcaab3f#diff-ad4fb56affb62e9f5024c32ea8a857376661813e1bc22b7dfef64f21ff16c34fR176)
|
@maitredede i you don't have time, i think i can take over with a new PR (keeping you as author of course). |
… be checked with os.IsTimeout()
|
Hello @quite, I have rebased/updated 😃 |
|
@maitredede great! I hope @cmaglie will get some time to look over this and merge it |
|
This would be very useful to have as I'm testing various types of connections and all of them have timeouts except for my serial ones and this would fix it. |
|
@cmaglie sorry to ping you as you said, on another issue, that there is no timeline for adding timeouts in a possible 2.0 version several months ago. |
|
What is the status of this? As timeouts are not respected, as highlighted by #141 (comment). |
Like
*net.Conn.Read()or*os.File.Read()when a timeout occurs, return an error that can be checked withos.IsTimeout()