Skip to content

ReadEvent blocks forever on closed connection #12

@nyxar

Description

@nyxar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions