Class: Argus::UdpSender

Inherits:
Object
  • Object
show all
Defined in:
lib/argus/udp_sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(udp_socket, host = nil, port = nil) ⇒ UdpSender

Returns a new instance of UdpSender.



3
4
5
6
7
# File 'lib/argus/udp_sender.rb', line 3

def initialize(udp_socket, host=nil, port=nil)
  @udp_socket = udp_socket
  @host = host || '192.168.1.1'
  @port = port || 5556
end

Instance Method Details

#send_packet(data) ⇒ Object



9
10
11
# File 'lib/argus/udp_sender.rb', line 9

def send_packet(data)
  @udp_socket.send(data, 0, @host, @port)
end