Module: Plum::ConnectionUtils
- Included in:
- Connection
- Defined in:
- lib/plum/connection_utils.rb
Instance Method Summary collapse
-
#goaway(error_type = :no_error, message = "") ⇒ 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, message = "") ⇒ Object
Sends GOAWAY frame to the peer and closes the connection.
22 23 24 25 |
# File 'lib/plum/connection_utils.rb', line 22 def goaway(error_type = :no_error, = "") last_id = @max_stream_ids.max send_immediately Frame.goaway(last_id, error_type, ) end |
#ping(data = "plum\x00\x00\x00\x00") ⇒ Object
Sends a PING frame to the peer.
16 17 18 |
# File 'lib/plum/connection_utils.rb', line 16 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
28 29 30 |
# File 'lib/plum/connection_utils.rb', line 28 def push_enabled? @remote_settings[:enable_push] == 1 end |