Skip to content

net: write(cb) not called if destroy():ed before 'connect' #30841

Description

@ronag

See #30839

_writeGeneric waits for 'connect'

node/lib/net.js

Line 759 in cf5ce2c

this.once('connect', function connect() {
which might never be emitted due to

node/lib/net.js

Lines 1106 to 1108 in cf5ce2c

if (self.destroyed) {
return;
}

I believe this will fail:

const socket = createSocketBeforeConnect();
socket.write('asd', common.mustCall());
socket.destroy();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions