Class: Quaff::TCPSource
Direct Known Subclasses
Instance Attribute Summary collapse
-
#sock ⇒ Object
readonly
Returns the value of attribute sock.
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
#remote_ip, #remote_port, #to_s
Constructor Details
#initialize(ip, port) ⇒ TCPSource
Returns a new instance of TCPSource.
46 47 48 49 50 |
# File 'lib/sources.rb', line 46 def initialize ip, port @transport = "TCP" @sock = TCPSocket.new ip, port @port, @ip = port, ip end |
Instance Attribute Details
#sock ⇒ Object (readonly)
Returns the value of attribute sock.
44 45 46 |
# File 'lib/sources.rb', line 44 def sock @sock end |
Instance Method Details
#close(cxn) ⇒ Object
56 57 58 59 |
# File 'lib/sources.rb', line 56 def close cxn @sock.close cxn.sockets.delete(@sock) end |
#send_msg(_, data) ⇒ Object
52 53 54 |
# File 'lib/sources.rb', line 52 def send_msg _, data @sock.sendmsg data end |