Class: LogStashLogger::Device::UDP

Inherits:
Socket show all
Defined in:
lib/logstash-logger/device/udp.rb

Constant Summary

Constants inherited from Socket

Socket::DEFAULT_HOST

Instance Attribute Summary

Attributes inherited from Socket

#host, #port

Attributes inherited from Connectable

#buffer_logger

Attributes inherited from Base

#error_logger, #io, #sync

Instance Method Summary collapse

Methods inherited from Socket

#initialize, #unrecoverable_error?

Methods inherited from Connectable

#close, #connected?, #flush, #initialize, #on_full_buffer_receive, #reconnect, #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, #initialize, #to_io, #unrecoverable_error?, #write, #write_batch, #write_one

Constructor Details

This class inherits a constructor from LogStashLogger::Device::Socket

Instance Method Details

#connectObject


4
5
6
7
8
9
# File 'lib/logstash-logger/device/udp.rb', line 4

def connect
  @io = UDPSocket.new.tap do |socket|
    socket.connect(@host, @port)
    socket.sync = sync unless sync.nil?
  end
end