class H2ClientProtocol(Protocol, TimeoutMixin): (source)
Implements interfaces: twisted.internet.interfaces.IHandshakeListener
Undocumented
Method | __init__ |
Arguments: uri -- URI of the base url to which HTTP/2 Connection will be made. uri is used to verify that incoming client requests have correct base URL. settings -- Scrapy project settings conn_lost_deferred -- Deferred fires with the reason: Failure to notify that connection was lost... |
Method | connection |
Undocumented |
Method | connection |
Called by Twisted when the transport connection is lost. No need to write anything to transport here. |
Method | connection |
Called by Twisted when the connection is established. We can start sending some data now: we should open with the connection preamble. |
Method | data |
Undocumented |
Method | data |
Undocumented |
Method | handshake |
Close the connection if it's not made via the expected protocol |
Method | pop |
Perform cleanup when a stream is closed |
Method | request |
Undocumented |
Method | response |
Undocumented |
Method | settings |
Undocumented |
Method | stream |
Undocumented |
Method | stream |
Undocumented |
Method | timeout |
Called when the connection times out. We lose the connection with TimeoutError |
Method | window |
Undocumented |
Constant | IDLE |
Undocumented |
Instance Variable | conn |
Undocumented |
Instance Variable | metadata |
Undocumented |
Instance Variable | streams |
Undocumented |
Property | allowed |
We keep total two streams for client (sending data) and server side (receiving data) for a single request. To be safe we choose the minimum. Since this value can change in event RemoteSettingsChanged we make variable a property. |
Property | h2 |
Boolean to keep track of the connection status. This is used while initiating pending streams to make sure that we initiate stream only during active HTTP/2 Connection |
Method | _check |
Checks for edge cases where the connection to remote fails without raising an appropriate H2Error |
Method | _handle |
Private method which acts as a bridge between the events received from the HTTP/2 data and IH2EventsHandler |
Method | _lose |
Helper function to lose the connection with the error sent as a reason |
Method | _new |
Instantiates a new Stream object |
Method | _send |
Initiate all pending requests from the deque following FIFO We make sure that at any time {allowed_max_concurrent_streams} streams are active. |
Method | _write |
Write data to the underlying transport connection from the HTTP2 connection instance if any |
Instance Variable | _conn |
Undocumented |
Instance Variable | _conn |
Undocumented |
Instance Variable | _pending |
Undocumented |
Instance Variable | _stream |
Undocumented |
Arguments: uri -- URI of the base url to which HTTP/2 Connection will be made. uri is used to verify that incoming client requests have correct base URL. settings -- Scrapy project settings conn_lost_deferred -- Deferred fires with the reason: Failure to notify that connection was lost
Called by Twisted when the transport connection is lost. No need to write anything to transport here.
Called by Twisted when the connection is established. We can start sending some data now: we should open with the connection preamble.
We keep total two streams for client (sending data) and server side (receiving data) for a single request. To be safe we choose the minimum. Since this value can change in event RemoteSettingsChanged we make variable a property.
Boolean to keep track of the connection status. This is used while initiating pending streams to make sure that we initiate stream only during active HTTP/2 Connection
Checks for edge cases where the connection to remote fails without raising an appropriate H2Error Arguments: data -- Data received from the remote
Private method which acts as a bridge between the events received from the HTTP/2 data and IH2EventsHandler Arguments: events -- A list of events that the remote peer triggered by sending data
Initiate all pending requests from the deque following FIFO We make sure that at any time {allowed_max_concurrent_streams} streams are active.