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

Added setKeepAlive on socket to prevent Timeout Errors #41

Closed
wants to merge 1 commit into from

Conversation

nitzo
Copy link

@nitzo nitzo commented May 3, 2016

No description provided.

@@ -155,6 +155,8 @@ Logstash.prototype.connect = function () {
} else {
this.socket = new net.Socket();
}

this.socket.setKeepAlive(true, 5000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the magic 5000 number? Is that what logstash requires?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any feedback on this?

bstream pushed a commit to bstream/winston-logstash that referenced this pull request Nov 21, 2017
* Prevent `Error: read ECONNRESET` when using net.socket by using
setKeepAlive when connecting.
* Use an `initialDelay` of 60 seconds.

Net -> socket.setKeepAlive:
https://nodejs.org/api/net.html#net_socket_setkeepalive_enable_initialdelay

Closes jaakkos#38, jaakkos#41
@jaakkos jaakkos closed this Nov 24, 2017
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

Successfully merging this pull request may close these issues.

3 participants