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

Making TCP_USER_TIMEOUT socket option user configurable #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/remote_syslog_sender/tcp_sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def initialize(remote_hostname, remote_port, options = {})
@timeout = options[:timeout] || 600
@timeout_exception = !!options[:timeout_exception]
@exponential_backoff = !!options[:exponential_backoff]
@tcp_user_timeout = options[:tcp_user_timeout] || 5

@mutex = Mutex.new
@tcp_socket = nil
Expand Down Expand Up @@ -54,7 +55,7 @@ def connect
close

@tcp_socket = TCPSocket.new(@remote_hostname, @remote_port)

@tcp_socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_USER_TIMEOUT, @tcp_user_timeout)
if @keep_alive
@tcp_socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
@tcp_socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_KEEPIDLE, @keep_alive_idle) if @keep_alive_idle
Expand Down
2 changes: 1 addition & 1 deletion remote_syslog_sender.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'remote_syslog_sender'
s.version = '1.2.2'
s.version = '1.2.3'
s.summary = "Message sender that sends directly to a remote syslog endpoint"
s.description = "Message sender that sends directly to a remote syslog endpoint (Support UDP, TCP, TCP+TLS)"

Expand Down