help icon indicating copy to clipboard operation
help copied to clipboard

Is SOCK_SEQPACKET supported?

Open chilicomputer opened this issue 9 years ago • 8 comments

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?

chilicomputer avatar Jun 29 '17 14:06 chilicomputer

Hey @chilicomputer 😺 did you get this working for you yet?

Knighton910 avatar Jul 07 '17 03:07 Knighton910

@lordKnighton No, still got the error

chilicomputer avatar Jul 13 '17 04:07 chilicomputer

@chilicomputer - is it still outstanding? if so, can you please provide the complete code that fails?

gireeshpunathil avatar Mar 11 '18 06:03 gireeshpunathil

closing due to inactivity, please re-open if it is still outstanding, but with required data, thanks!

gireeshpunathil avatar Mar 14 '18 04:03 gireeshpunathil

The same here.

Globik avatar May 17 '18 18:05 Globik

The same here.

leeight avatar Oct 11 '18 09:10 leeight

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

gabsn avatar Jan 07 '19 19:01 gabsn

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.

oyyd avatar Aug 26 '22 11:08 oyyd