Skip to content

do not propagate "use of closed conn" error if expected#92

Open
costela wants to merge 1 commit into
soheilhy:masterfrom
costela:do_not_propagate_accept_error_if_expected
Open

do not propagate "use of closed conn" error if expected#92
costela wants to merge 1 commit into
soheilhy:masterfrom
costela:do_not_propagate_accept_error_if_expected

Conversation

@costela
Copy link
Copy Markdown

@costela costela commented Feb 9, 2022

There's unfortunately no way (AFAIK) of actively interrupting a
net.Listener.Accept() call, so we have to deal with it erroring out if/when
its net.Listener is closed (see #39).

Unfortunately(2) there's also no better way of matching the low-level
error than string checks, since it is not exported by the stdlib.

There's unfortunately no way (AFAIK) of actively interrupting a
net.Listener.Accept() call, so we have to deal with it erroring out when
its net.Listener is closed.
Unfortunately(2) there's also no better way of matching the low-level
error than string checks, since it is not exported by the stdlib.
@vtolstov
Copy link
Copy Markdown

vtolstov commented Mar 20, 2022

with never version of go you can do errors.Is
and such error already public exported

@costela
Copy link
Copy Markdown
Author

costela commented Mar 20, 2022

hi @vtolstov

Not sure I understand what you mean. Go 1.18 still hasn't exported the underlying error. (note the internal path)

Or am I missing something? 🤔

(nevermind; see below)

@costela
Copy link
Copy Markdown
Author

costela commented Mar 20, 2022

Ah, I take it back: looks like it was indirectly exported in 1.16.

I'll see if that works.

@vtolstov
Copy link
Copy Markdown

Ah, I take it back: looks like it was indirectly exported in 1.16.

I'll see if that works.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants