soheilhy / cmux

Connection multiplexer for GoLang: serve different services on the same port!
Apache License 2.0
2.53k stars 197 forks source link

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

Open costela opened 2 years ago

costela commented 2 years ago

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.

vtolstov commented 2 years ago

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

costela commented 2 years ago

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? :thinking:~

(nevermind; see below)

costela commented 2 years ago

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

I'll see if that works.

vtolstov commented 2 years ago

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

I'll see if that works.

yes