Class: WebRTC::RTCDtlsTransport

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

Constant Summary collapse

STATES =
%i[new connecting connected closed failed].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RTCDtlsTransport

Returns a new instance of RTCDtlsTransport.



9
10
11
12
13
14
15
# File 'lib/webrtc/dtls_transport.rb', line 9

def initialize(options = {})
  @ice_transport = options[:ice_transport] || RTCIceTransport.new
  @state = :new
  @remote_certificates = []
  @callbacks = {}
  @ptr = options[:ptr]
end

Instance Attribute Details

#ice_transportObject (readonly)

Returns the value of attribute ice_transport.



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

def ice_transport
  @ice_transport
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

Instance Method Details

#get_remote_certificatesObject



17
18
19
# File 'lib/webrtc/dtls_transport.rb', line 17

def get_remote_certificates
  @remote_certificates.dup
end

#on_error(&block) ⇒ Object



25
26
27
# File 'lib/webrtc/dtls_transport.rb', line 25

def on_error(&block)
  @callbacks[:error] = block
end

#on_state_change(&block) ⇒ Object



21
22
23
# File 'lib/webrtc/dtls_transport.rb', line 21

def on_state_change(&block)
  @callbacks[:state_change] = block
end