Class: Quaff::Source

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

Overview

A Source is an abstraction representing an IP address/port/transport where a SIP message originates from or can be sent to. It allows users to abstract over TCP and UDP sockets.

Direct Known Subclasses

TCPSource, UDPSource

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ipObject (readonly)

Returns the value of attribute ip.



7
8
9
# File 'lib/sources.rb', line 7

def ip
  @ip
end

#portObject (readonly)

Returns the value of attribute port.



7
8
9
# File 'lib/sources.rb', line 7

def port
  @port
end

#sockObject (readonly)

Returns the value of attribute sock.



7
8
9
# File 'lib/sources.rb', line 7

def sock
  @sock
end

#transportObject (readonly)

Returns the value of attribute transport.



7
8
9
# File 'lib/sources.rb', line 7

def transport
  @transport
end

Instance Method Details

#close(cxn) ⇒ Object

Designed to be overriden by subclasses



10
11
# File 'lib/sources.rb', line 10

def close cxn
end

#to_sObject



13
14
15
# File 'lib/sources.rb', line 13

def to_s
  "#{@ip}:#{@port} (#{@transport})"
end