Class: Quaff::TCPSIPEndpoint

Inherits:
BaseEndpoint show all
Defined in:
lib/endpoint.rb

Instance Attribute Summary collapse

Attributes inherited from BaseEndpoint

#instance_id, #local_port, #msg_log, #msg_trace, #sdp_port, #sdp_socket, #uri

Instance Method Summary collapse

Methods inherited from BaseEndpoint

#create_aka_client, #create_client, #create_server, #get_new_message, #incoming_call, #initialize, #mark_call_dead, #outgoing_call, #register, #send_msg, #set_aka_credentials, #setup_sdp, #unregister

Constructor Details

This class inherits a constructor from Quaff::BaseEndpoint

Instance Attribute Details

#socketsObject

Returns the value of attribute sockets.



204
205
206
# File 'lib/endpoint.rb', line 204

def sockets
  @sockets
end

Instance Method Details

#add_sock(sock) ⇒ Object



214
215
216
# File 'lib/endpoint.rb', line 214

def add_sock sock
  @sockets.push sock
end

#new_source(host, port) ⇒ Object Also known as: new_connection



210
211
212
# File 'lib/endpoint.rb', line 210

def new_source host, port
  return TCPSource.new host, port
end

#terminateObject



218
219
220
221
222
223
224
225
# File 'lib/endpoint.rb', line 218

def terminate
  oldsockets = @sockets.dup
  @sockets = []
  oldsockets.each do |s| s.close unless s.closed? end
  mycxn = @cxn
  @cxn = nil
  mycxn.close
end

#transportObject



206
207
208
# File 'lib/endpoint.rb', line 206

def transport
  "TCP"
end