Class: RemoteSyslogLogger::TcpSender
- Defined in:
- lib/remote_syslog_logger/tcp_sender.rb
Instance Method Summary collapse
-
#initialize(remote_hostname, remote_port, options = {}) ⇒ TcpSender
constructor
A new instance of TcpSender.
Methods inherited from Sender
Constructor Details
#initialize(remote_hostname, remote_port, options = {}) ⇒ TcpSender
Returns a new instance of TcpSender.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/remote_syslog_logger/tcp_sender.rb', line 7 def initialize(remote_hostname, remote_port, = {}) super @tls = [:tls] @retry_limit = [:retry_limit] || 3 @remote_hostname = remote_hostname @remote_port = remote_port @ssl_method = [:ssl_method] || 'TLSv1_2' @ca_file = [:ca_file] @verify_mode = [:verify_mode] if [:SOL_SOCKET, :SO_KEEPALIVE, :IPPROTO_TCP, :TCP_KEEPIDLE].all? {|c| Socket.const_defined? c} @keep_alive = [:keep_alive] end if Socket.const_defined?(:TCP_KEEPIDLE) @keep_alive_idle = [:keep_alive_idle] end if Socket.const_defined?(:TCP_KEEPCNT) @keep_alive_cnt = [:keep_alive_cnt] end if Socket.const_defined?(:TCP_KEEPINTVL) @keep_alive_intvl = [:keep_alive_intvl] end connect end |