How can I get the file descriptor (respectively its path) of a socket?
I can open a file descriptor when I know its path like this:
var fd = require("fs").createReadStream(pathOfFileDescriptor);
for example
require("fs").createReadStream("/proc/"+process.pid+"/fd/0").on("data",function(d){
console.log("The following data comes from stdin: "+d);
});
Now, how can I know which file descriptor file is for which socket?
Hope someone can help!
This seems not to be possible at the moment. Maybe it will come in future versions of node.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With