class EMStatsd::UDPWrapper

Attributes

connection[R]

Public Class Methods

new(host, port) click to toggle source
# File lib/em_statsd/udp_wrapper.rb, line 6
def initialize(host, port)
  @host, @port = host, port
  # eventmachine forces us to listen on a UDP socket even
  # though we only
  # want to send, so we'll just give it a junk address
  @connection = EM.open_datagram_socket('0.0.0.0', 0, EM::Connection)
end

Public Instance Methods

close() click to toggle source
# File lib/em_statsd/udp_wrapper.rb, line 14
def close
  connection.close_connection_after_writing
end
flush() click to toggle source
# File lib/em_statsd/udp_wrapper.rb, line 18
def flush

end
write(message) click to toggle source
# File lib/em_statsd/udp_wrapper.rb, line 22
def write(message)
  connection.send_datagram(message, @host, @port)
end