Class: Quaff::TCPSource
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Source
#ip, #port, #sock, #transport
Instance Method Summary collapse
- #close(cxn) ⇒ Object
-
#initialize(ip, port) ⇒ TCPSource
constructor
A new instance of TCPSource.
- #send_msg(_, data) ⇒ Object
Methods inherited from Source
Constructor Details
#initialize(ip, port) ⇒ TCPSource
Returns a new instance of TCPSource.
39 40 41 42 43 |
# File 'lib/sources.rb', line 39 def initialize ip, port @transport = "TCP" @sock = TCPSocket.new ip, port @port, @ip = port, ip end |
Instance Method Details
#close(cxn) ⇒ Object
49 50 51 52 |
# File 'lib/sources.rb', line 49 def close cxn @sock.close cxn.sockets.delete(@sock) end |
#send_msg(_, data) ⇒ Object
45 46 47 |
# File 'lib/sources.rb', line 45 def send_msg _, data @sock.sendmsg data end |