Class: Protocol::WebSocket::PingFrame

Inherits:
Frame
  • Object
show all
Defined in:
lib/protocol/websocket/ping_frame.rb

Constant Summary collapse

OPCODE =
0x9

Instance Attribute Summary

Attributes inherited from Frame

#finished, #length, #mask, #opcode, #payload

Instance Method Summary collapse

Methods inherited from Frame

#<=>, #continued?, #control?, #data?, #finished?, #initialize, #pack, parse_header, read, #to_ary, #unpack, #write

Constructor Details

This class inherits a constructor from Protocol::WebSocket::Frame

Instance Method Details

#apply(connection) ⇒ Object



33
34
35
# File 'lib/protocol/websocket/ping_frame.rb', line 33

def apply(connection)
	connection.receive_ping(self)
end

#replyObject



29
30
31
# File 'lib/protocol/websocket/ping_frame.rb', line 29

def reply
	PongFrame.new(true, @payload, mask: @mask)
end