Module: Plum::ConnectionUtils
- Included in:
- Connection
- Defined in:
- lib/plum/connection_utils.rb
Instance Method Summary collapse
-
#goaway(error_type = :no_error) ⇒ Object
Sends GOAWAY frame to the peer and closes the connection.
-
#ping(data = "plum\x00\x00\x00\x00") ⇒ Object
Sends a PING frame to the peer.
-
#push_enabled? ⇒ Boolean
Returns whether peer enables server push or not.
-
#settings(**kwargs) ⇒ Object
Sends local settings to the peer.
Instance Method Details
#goaway(error_type = :no_error) ⇒ Object
Sends GOAWAY frame to the peer and closes the connection.
21 22 23 24 |
# File 'lib/plum/connection_utils.rb', line 21 def goaway(error_type = :no_error) last_id = @max_odd_stream_id > @max_even_stream_id ? @max_odd_stream_id : @max_even_stream_id send_immediately Frame.goaway(last_id, error_type) end |
#ping(data = "plum\x00\x00\x00\x00") ⇒ Object
Sends a PING frame to the peer.
15 16 17 |
# File 'lib/plum/connection_utils.rb', line 15 def ping(data = "plum\x00\x00\x00\x00") send_immediately Frame.ping(data) end |
#push_enabled? ⇒ Boolean
Returns whether peer enables server push or not
27 28 29 |
# File 'lib/plum/connection_utils.rb', line 27 def push_enabled? @remote_settings[:enable_push] == 1 end |
#settings(**kwargs) ⇒ Object
Sends local settings to the peer.
7 8 9 10 |
# File 'lib/plum/connection_utils.rb', line 7 def settings(**kwargs) send_immediately Frame.settings(**kwargs) update_local_settings(kwargs) end |