Class: Quaff::TCPSIPEndpoint

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

Instance Attribute Summary collapse

Attributes inherited from BaseEndpoint

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

Instance Method Summary collapse

Methods inherited from BaseEndpoint

#add_contact_param, #add_contact_uri_param, #contact_header, #create_aka_client, #create_client, #create_server, #get_new_message, #incoming_call, #initialize, #mark_call_dead, #outgoing_call, #register, #remove_contact_param, #remove_contact_uri_param, #send_msg, #set_aka_credentials, #setup_sdp, #terminate, #unregister

Constructor Details

This class inherits a constructor from Quaff::BaseEndpoint

Instance Attribute Details

#socketsObject

Returns the value of attribute sockets.



257
258
259
# File 'lib/endpoint.rb', line 257

def sockets
  @sockets
end

Instance Method Details

#add_sock(sock) ⇒ Object



267
268
269
# File 'lib/endpoint.rb', line 267

def add_sock sock
  @sockets.push sock
end

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



263
264
265
# File 'lib/endpoint.rb', line 263

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

#terminate_specificObject



271
272
273
274
275
276
277
278
# File 'lib/endpoint.rb', line 271

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

#transportObject



259
260
261
# File 'lib/endpoint.rb', line 259

def transport
  "TCP"
end