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 Base

#io, #sync

Instance Method Summary collapse

Methods inherited from Socket

#initialize

Methods inherited from Connectable

#connected?, #flush, #to_io, #write

Methods inherited from Base

#close, #flush, #initialize, #to_io, #write

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