Class: SPDY::Parser

Inherits:
Object
  • Object
show all
Includes:
Protocol
Defined in:
lib/spdy/parser.rb

Constant Summary

Constants included from Protocol

SPDY::Protocol::CONTROL_BIT, SPDY::Protocol::DATA_BIT, SPDY::Protocol::SETTINGS_CURRENT_CWND, SPDY::Protocol::SETTINGS_DOWNLOAD_BANDWIDTH, SPDY::Protocol::SETTINGS_MAX_CONCURRENT_STREAMS, SPDY::Protocol::SETTINGS_ROUND_TRIP_TIME, SPDY::Protocol::SETTINGS_UPLOAD_BANDWIDTH, SPDY::Protocol::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



7
8
9
10
# File 'lib/spdy/parser.rb', line 7

def initialize
  @buffer = ''
  @zlib_session = Zlib.new
end

Instance Attribute Details

#zlib_sessionObject (readonly)

Returns the value of attribute zlib_session.



5
6
7
# File 'lib/spdy/parser.rb', line 5

def zlib_session
  @zlib_session
end

Instance Method Details

#<<(data) ⇒ Object



12
13
14
15
# File 'lib/spdy/parser.rb', line 12

def <<(data)
  @buffer << data
  try_parse
end

#on_body(&blk) ⇒ Object



21
22
23
# File 'lib/spdy/parser.rb', line 21

def on_body(&blk)
  @on_body = blk
end

#on_headers_complete(&blk) ⇒ Object



17
18
19
# File 'lib/spdy/parser.rb', line 17

def on_headers_complete(&blk)
  @on_headers_complete = blk
end

#on_message_complete(&blk) ⇒ Object



25
26
27
# File 'lib/spdy/parser.rb', line 25

def on_message_complete(&blk)
  @on_message_complete = blk
end