Class: Quaff::TCPSourceFromSocket

Inherits:
TCPSource show all
Defined in:
lib/sources.rb

Instance Attribute Summary

Attributes inherited from Source

#ip, #port, #sock, #transport

Instance Method Summary collapse

Methods inherited from TCPSource

#close, #send_msg

Methods inherited from Source

#close, #to_s

Constructor Details

#initialize(sock) ⇒ TCPSourceFromSocket

Returns a new instance of TCPSourceFromSocket.



56
57
58
59
60
# File 'lib/sources.rb', line 56

def initialize sock
  @transport = "TCP"
  @sock = sock
  @port, @ip = Socket.unpack_sockaddr_in(@sock.getpeername)
end