You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Node the following code will print the file descriptor, but in Deno the socket._handle.fd will be undefined, I noticed there is a gap in compatibility , I would like to address this sending small PRs to close the Socket fd compatibility gap.
import {createServer} from "node:net"
// Create a TCP server
const server = createServer((socket) => {
console.log('Client connected');
// Access the file descriptor of the socket
const fd = socket._handle.fd;
console.log('Socket file descriptor:', fd);
socket.on('data', (data) => {
console.log('Received data:', data.toString());
});
socket.on('end', () => {
console.log('Client disconnected');
});
});
// Bind the server to a port
server.listen(8080, '0.0.0.0', () => {
console.log('Server listening on port 8080');
});
…back socket object
This PR will address the node compatibility issue where, the callback socket
object in net.createServer is missing a fd in socket._handle
fixes: denoland#27788
…lback socket object
This PR will address the node compatibility issue where, the callback socket
object in net.createServer is missing a fd in socket._handle
fixes: denoland#27788
…lback socket object
This PR will address the node compatibility issue where, the callback socket
object in net.createServer is missing a fd in socket._handle
fixes: denoland#27788
In Node the following code will print the file descriptor, but in Deno the
socket._handle.fd
will be undefined, I noticed there is a gap in compatibility , I would like to address this sending small PRs to close the Socket fd compatibility gap.Version:
deno 2.1.7 (stable, debug, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2
The text was updated successfully, but these errors were encountered: