Open
Description
- Version: 14.16.0
- Platform: MacOS
- Subsystem: macOS Catalina 10.15.7
What steps will reproduce the bug?
const net = require("net")
const srv = net.createServer()
srv.on("connection", c => {
const sock = new net.Socket({
fd: c._handle.fd
})
})
srv.listen(4444)
How often does it reproduce? Is there a required condition?
No required condition (as far as I can tell).
What is the expected behavior?
That a new net.Socket
instance is created which behaves exactly like the original instance (c
in this case).
What do you see instead?
An error is thrown (EEXISTS):
net.js:337
throw errnoException(err, 'open');
^
Error: open EEXIST
at new Socket (net.js:337:15)
at Server.<anonymous> (test.js:6:15)
at Server.emit (events.js:315:20)
at TCP.onconnection (net.js:1560:8) {
errno: -17,
code: 'EEXIST',
syscall: 'open'
}
Activity