Skip to content

readable event not emitted after net.Socket reconnects #25969

Closed
@morkai

Description

@morkai
  • Version: v10.15.1
  • Platform: Windows 10 Pro 64-bit
  • Subsystem: net

If net.Socket loses connection (close is emitted) and the same socket instance is used to reconnect to the same server, no more readable events are emitted (data events are still emitted).

Doesn't work in v10.14/v10.15.1. Works in v8.15.0.

Repro: https://gist.github.com/morkai/fa175bd0104443e6142f3d0e22805653

  1. Run server.js
  2. Run client.js
  3. Client prints client#readable
  4. Kill the server
  5. Run the server again
  6. Client reconnects
  7. Client doesn't print any client#readable lines
  8. Kill the client
  9. Uncomment the data event handler and comment the readable handler in client.js
  10. Run the client
  11. Client prints client#data
  12. Kill the server
  13. Run the server again
  14. Client reconnects
  15. Client resumes printing client#data lines

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.netIssues and PRs related to the net subsystem.streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions