Method: Protocol::HTTP2::Connection#next_stream_id

Defined in:
lib/protocol/http2/connection.rb

#next_stream_idObject

Streams are identified with an unsigned 31-bit integer. Streams initiated by a client MUST use odd-numbered stream identifiers; those initiated by the server MUST use even-numbered stream identifiers. A stream identifier of zero (0x0) is used for connection control messages; the stream identifier of zero cannot be used to establish a new stream.



123
124
125
126
127
128
129
# File 'lib/protocol/http2/connection.rb', line 123

def next_stream_id
  id = @local_stream_id
  
  @local_stream_id += 2
  
  return id
end