Skip to content

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

Closed
@ronag

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with 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