net: `write(cb)` not called if `destroy()`:ed before `'connect'` · Issue #30841 · nodejs/node · GitHub
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

which might never be emitted due to

node/lib/net.js

Lines 1106 to 1108 in cf5ce2c

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions