Skip to content

Readable state not reset after close #7

@moll

Description

@moll

Hey,

It's not exactly straight-forward to reuse an existing Socket between connects. It does tend to work mostly, but I just spent some time trying to figure out why pipes failed to reattach (as an error on a ReadableStream causes it to drop all of its pipe partners) between reconnect attempts. Finally tracked it down to socket._readableState.endEmitted being true in the window between a close (e.g. one for a failed connect attempt) and calling Socket.prototype.connect, something which EverSocket does with a timeout.

You might want to either document these idiosyncrasies or figure out a way to reset the socket after a failed connect attempt, so it'll behave similarly to a socket that has never been connected.

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