Class: Protocol::WebSocket::Framer
- Inherits:
-
Object
- Object
- Protocol::WebSocket::Framer
- Defined in:
- lib/protocol/websocket/framer.rb
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(stream) ⇒ Framer
constructor
A new instance of Framer.
- #read_frame ⇒ Object
- #read_message ⇒ Object
- #write_frame(frame) ⇒ Object
- #write_message(opcode, payload) ⇒ Object
Constructor Details
#initialize(stream) ⇒ Framer
Returns a new instance of Framer.
26 27 28 |
# File 'lib/protocol/websocket/framer.rb', line 26 def initialize(stream) @stream = stream end |
Instance Method Details
#close ⇒ Object
30 31 32 |
# File 'lib/protocol/websocket/framer.rb', line 30 def close @stream.close end |
#flush ⇒ Object
34 35 36 |
# File 'lib/protocol/websocket/framer.rb', line 34 def flush @stream.flush end |
#read_frame ⇒ Object
38 39 40 |
# File 'lib/protocol/websocket/framer.rb', line 38 def read_frame Frame.read(@stream) end |
#read_message ⇒ Object
42 43 44 |
# File 'lib/protocol/websocket/framer.rb', line 42 def end |
#write_frame(frame) ⇒ Object
49 50 51 |
# File 'lib/protocol/websocket/framer.rb', line 49 def write_frame(frame) frame.write(@stream) end |
#write_message(opcode, payload) ⇒ Object
46 47 |
# File 'lib/protocol/websocket/framer.rb', line 46 def (opcode, payload) end |