Class: WebRTC::RTCDtlsTransport
- Inherits:
-
Object
- Object
- WebRTC::RTCDtlsTransport
- Defined in:
- lib/webrtc/dtls_transport.rb
Constant Summary collapse
- STATES =
%i[new connecting connected closed failed].freeze
Instance Attribute Summary collapse
-
#ice_transport ⇒ Object
readonly
Returns the value of attribute ice_transport.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #get_remote_certificates ⇒ Object
-
#initialize(options = {}) ⇒ RTCDtlsTransport
constructor
A new instance of RTCDtlsTransport.
- #on_error(&block) ⇒ Object
- #on_state_change(&block) ⇒ Object
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( = {}) @ice_transport = [:ice_transport] || RTCIceTransport.new @state = :new @remote_certificates = [] @callbacks = {} @ptr = [:ptr] end |
Instance Attribute Details
#ice_transport ⇒ Object (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 |
#state ⇒ Object (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_certificates ⇒ Object
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 |