Class: LogStashLogger::Device::Socket
- Inherits:
-
Connectable
- Object
- Base
- Connectable
- LogStashLogger::Device::Socket
- Defined in:
- lib/logstash-logger/device/socket.rb
Constant Summary collapse
- DEFAULT_HOST =
'0.0.0.0'
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Attributes inherited from Connectable
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(opts) ⇒ Socket
constructor
A new instance of Socket.
- #unrecoverable_error?(e) ⇒ Boolean
Methods inherited from Connectable
#close, #connect, #connected?, #flush, #on_full_buffer_receive, #reconnect, #reset, #to_io, #with_connection, #write, #write_batch, #write_one
Methods included from Buffer
#buffer_flush, #buffer_full?, #buffer_initialize, #buffer_receive, #reset_buffer
Methods inherited from Base
#close, #close!, #flush, #reset, #to_io, #write, #write_batch, #write_one
Constructor Details
#initialize(opts) ⇒ Socket
Returns a new instance of Socket.
10 11 12 13 14 |
# File 'lib/logstash-logger/device/socket.rb', line 10 def initialize(opts) super @port = opts[:port] || fail(ArgumentError, "Port is required") @host = opts[:host] || DEFAULT_HOST end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/logstash-logger/device/socket.rb', line 8 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
8 9 10 |
# File 'lib/logstash-logger/device/socket.rb', line 8 def port @port end |
Instance Method Details
#unrecoverable_error?(e) ⇒ Boolean
16 17 18 |
# File 'lib/logstash-logger/device/socket.rb', line 16 def unrecoverable_error?(e) e.is_a?(Errno::EMSGSIZE) || super end |