Class: Quaff::UDPSource

Inherits:
Source
  • Object
show all
Defined in:
lib/sources.rb

Direct Known Subclasses

UDPSourceFromAddrinfo

Instance Method Summary collapse

Methods inherited from Source

#close, #remote_ip, #remote_port, #sock, #to_s

Constructor Details

#initialize(ip, port) ⇒ UDPSource

Returns a new instance of UDPSource.



25
26
27
28
# File 'lib/sources.rb', line 25

def initialize ip, port
  @transport = "UDP"
  @ip, @port = ip, port
end

Instance Method Details

#send_msg(cxn, data) ⇒ Object



30
31
32
# File 'lib/sources.rb', line 30

def send_msg cxn, data
  cxn.send(data, 0, @ip, @port)
end