Class: Quaff::UDPSource

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

Direct Known Subclasses

UDPSourceFromAddrinfo

Instance Attribute Summary

Attributes inherited from Source

#ip, #port, #sock, #transport

Instance Method Summary collapse

Methods inherited from Source

#close, #to_s

Constructor Details

#initialize(ip, port) ⇒ UDPSource

Returns a new instance of UDPSource.



19
20
21
22
# File 'lib/sources.rb', line 19

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

Instance Method Details

#send_msg(cxn, data) ⇒ Object



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

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