Open jfallows opened 7 years ago
HTTP Nukleus as a server now supports multiple requests on the same transport, and connection pooling has been implemented for HTTP Nukleus when acting as a client. I am however leaving this issue open because if a few more loose ends need tidying up:
HTTP/1.1 supports reuse of the underlying connection to avoid setup and teardown overhead. Each underlying connection consists of a pair of correlated input and output transport streams.
Connection reuse includes decoding (server) or encoding (client) multiple HTTP/1.1 requests on the same transport, but the transport is only eligible for reuse if the previous request has already been sent a response (server) or received a response (client).
Note: allowing subsequent requests inbound on the same transport stream while a previous response is still pending requires more complete support for HTTP/1.1 pipelining, which is problematic because responses must be written in the same order as the corresponding requests even though the work done to produce those responses may complete in a different order.
An outbound HTTP request that would most naturally target an existing transport stream, may need to either trigger creation of a new transport stream, or remain cached until an underlying transport stream becomes available.