Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadEvent blocks forever on closed connection #12

Open
nyxar opened this issue Jun 21, 2021 · 0 comments
Open

ReadEvent blocks forever on closed connection #12

nyxar opened this issue Jun 21, 2021 · 0 comments

Comments

@nyxar
Copy link

nyxar commented Jun 21, 2021

Easily reproducible:

eslConn.Close()
eslConn.Send("connect")
ev, err := eslConn.ReadEvent()

No errors are emitted to the ReadEvent in this case, since it just listens on channels with no timeout or check against the connection state, and the err is read off h.err by the call to Send, I believe.

I propose adding a simple ReadWithTimeout, ReadWithDeadline, or ReadWithContext function to alleviate the issue, allowing us to back out of that select. Else, the connection error state needs to be persistent when ReadEvent is used.

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

No branches or pull requests

1 participant