Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 6.11 net.Socket - Needs socket.unref() etc #96

Open
PWBENNETT opened this issue Feb 25, 2018 · 0 comments
Open

Node 6.11 net.Socket - Needs socket.unref() etc #96

PWBENNETT opened this issue Feb 25, 2018 · 0 comments

Comments

@PWBENNETT
Copy link

PWBENNETT commented Feb 25, 2018

I don't know whether this still applies to modern Node, but for obscure reasons I'm using 6.11, and winston-syslog when using TCP needs a process.on('exit', ...) handler (I think in connect()) that performs ...

if (!this.isDgram) {
  this.socket.unref();
  this.socket.end();
  this.socket.destroy();
}

... otherwise the server side doesn't tear down its side of the TCP connection, and the number of "established" connections showing from the client side increases until such point as the syslog service (or the kernel or something) blocks that client. Effectively, you can DoS yourself if you have lots of short-running Node apps that do syslog over TCP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant