Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loop ¶
type Loop struct { HttpRequests chan (message.HttpRequest) MonitoringRequests chan (message.MonitoringRequest) IncomingFrames chan (frames.Frame) Shutdown chan (bool) Host string Port int }
func Start ¶
Start starts the event loop managing the HTTP/2 communication with a server.
A lot of HTTP/2 features are hard to implement in a thread safe way:
- Push promises arriving while the client sends a request at the same time.
- Window updates increase the flow control window while the client sends data and decreases the flow control window at the same time.
- etc.
Therefore, each HTTP/2 connection is handled single thread in h2c.
The eventloop takes all events, and executes them sequentially in a single thread. The implementation in github.com/fstab/h2c/http2client/connection does not need to care about thread safety.
There are two sources of events:
1. Command line: A user types a comand in order to send a GET, POST, ... request. 2. Network Socket: Frames received from the server.
Click to show internal directories.
Click to hide internal directories.