Class: WebRTC::RTCSctpTransport
- Inherits:
-
Object
- Object
- WebRTC::RTCSctpTransport
- Defined in:
- lib/webrtc/sctp_transport.rb
Constant Summary collapse
- STATES =
%i[connecting connected closed].freeze
Instance Attribute Summary collapse
-
#max_channels ⇒ Object
readonly
Returns the value of attribute max_channels.
-
#max_message_size ⇒ Object
readonly
Returns the value of attribute max_message_size.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#transport ⇒ Object
readonly
Returns the value of attribute transport.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RTCSctpTransport
constructor
A new instance of RTCSctpTransport.
- #on_state_change(&block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RTCSctpTransport
Returns a new instance of RTCSctpTransport.
9 10 11 12 13 14 15 16 |
# File 'lib/webrtc/sctp_transport.rb', line 9 def initialize( = {}) @transport = [:transport] || RTCDtlsTransport.new @state = :connecting @max_message_size = [:max_message_size] || 262_144 @max_channels = [:max_channels] || 65_535 @callbacks = {} @ptr = [:ptr] end |
Instance Attribute Details
#max_channels ⇒ Object (readonly)
Returns the value of attribute max_channels.
7 8 9 |
# File 'lib/webrtc/sctp_transport.rb', line 7 def max_channels @max_channels end |
#max_message_size ⇒ Object (readonly)
Returns the value of attribute max_message_size.
7 8 9 |
# File 'lib/webrtc/sctp_transport.rb', line 7 def @max_message_size end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/webrtc/sctp_transport.rb', line 7 def state @state end |
#transport ⇒ Object (readonly)
Returns the value of attribute transport.
7 8 9 |
# File 'lib/webrtc/sctp_transport.rb', line 7 def transport @transport end |
Instance Method Details
#on_state_change(&block) ⇒ Object
18 19 20 |
# File 'lib/webrtc/sctp_transport.rb', line 18 def on_state_change(&block) @callbacks[:state_change] = block end |