axon icon indicating copy to clipboard operation
axon copied to clipboard

Fix unixsockets

Open guybrush opened this issue 12 years ago • 11 comments

  • reconnect now works properly with unixsockets
  • the callback function passed to socket.listen() will return the EADDRINUSE if the attempt to connect does not result in ECONNREFUSED
  • provide a callback to fs.link() when recycling the stale socket file (see 1)

guybrush avatar Oct 29 '13 12:10 guybrush

haha ugh.. and the maintenance begins, I still sort of feel like unix domain sockets is a big meh, it's easy to do ephemeral stuff over tcp

tj avatar Oct 30 '13 01:10 tj

maybe we should revert that support

tj avatar Oct 30 '13 01:10 tj

i looked into this lib because of unix-sockets in the first place, because i needed to do stuff on foreign system

i dont see why you wouldnt support them since its not so much weight, but its your call and im not the guy who stands behind the lib and ensures everything is ok :D

guybrush avatar Oct 30 '13 03:10 guybrush

i just feel like they're really minimal win, there's almost never a valid reason for using them instead of regular old tcp, not that they're bad either but it is more stuff that needs testing/maintenance/docs

tj avatar Oct 30 '13 04:10 tj

hm maybe put it into another module which can be used to wrap axon?

var u = require('axon-unix')
var a = require('axon')
var s = a.socket('req')
var c = a.socket('rep')
u(s).bind('/path/to/socket')
u(c).connect('/path/to/socket')

guybrush avatar Oct 30 '13 04:10 guybrush

Yeah, they are not horrible but I feel like the whole unlinking and what not will stir up all kinds of non-issues that will still need to be looked into.

gjohnson avatar Oct 30 '13 14:10 gjohnson

Since were trimming down for 2.0, we should back out unix sockets there probably. Thoughts?

gjohnson avatar Feb 02 '14 03:02 gjohnson

better no unix-sockets than a half-implemented thing (imho)

guybrush avatar Feb 02 '14 05:02 guybrush

im down for removing them

tj avatar Feb 02 '14 21:02 tj

Err... don't remove that, pleeeease. I was about to suggest using unix sockets instead of tcp for pm2, and it'd kinda sad if it'll be removed. :P

In theory, with unix sockets it's easier to manage permissions, since socket is just a file. With tcp you need to set up an authentication and all that crap.

rlidwka avatar Feb 02 '14 23:02 rlidwka

Please don't remove unix sockets, better performance then tcp. 33% better ?http://stackoverflow.com/questions/257433/postgresql-unix-domain-sockets-vs-tcp-sockets/257479#257479 #150 seems to fix reconnect issue.

sladec avatar Apr 12 '16 18:04 sladec