class Argus::UdpSender

Public Class Methods

new(opts={}) click to toggle source
  # File lib/argus/udp_sender.rb
3 def initialize(opts={})
4   @udp_socket = opts[:socket] || UDPSocket.new
5   @host = opts.fetch(:remote_host)
6   @port = opts.fetch(:port, 5556)
7 end

Public Instance Methods

send_packet(data) click to toggle source
   # File lib/argus/udp_sender.rb
 9 def send_packet(data)
10   @udp_socket.send(data, 0, @host, @port)
11 end