Is SOCK_SEQPACKET supported?
When i tried to connect a unix domain socket, a EPROTOTYPE error happened. The code:
net.createConnection({path:'/tmp/xxx.seqpacket.sock'}, (e)=> {... })
Followed:
Error: connect EPROTOTYPE /tmp/xxx.seqpacket.sock
at Object.exports._errnoException (util.js:874:11)
at exports._exceptionWithHostPort (util.js:897:20)
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
So, what happened?
Hey @chilicomputer 😺 did you get this working for you yet?
@lordKnighton No, still got the error
@chilicomputer - is it still outstanding? if so, can you please provide the complete code that fails?
closing due to inactivity, please re-open if it is still outstanding, but with required data, thanks!
The same here.
The same here.
The same here.
Here is the code I used:
import * as net from "net";
let client = net
.createConnection("/var/run/dogstatsd/dsd.sock")
.on("connect", () => {
console.log("Connected.");
})
// Messages are buffers. use toString
.on("data", function(data: any) {
data = data.toString();
console.log(data);
})
.on("error", function(data: any) {
data = data.toString();
console.error(data);
});
Got the following error:
> ts-node connect_to_uds_socket.ts
Error: connect EPROTOTYPE /var/run/dogstatsd/dsd.sock
Env
ts-node v7.0.1
node v11.3.0
typescript v3.2.2
For those who need SOCK_SEQPACKET sockets, you may try https://www.npmjs.com/package/node-unix-socket that used in our internal server-side APM.