From HTTP channels, transactions connections to TCP sockets - how does this all come together?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

From HTTP channels, transactions connections to TCP sockets - how does this all come together?

ev0ltn
Hey.

I've been trying to dig into the Necko source a bit, but I'm having problems understanding the architecture here. I'll just ask what keeps bugging me, any information/pointers at all is uber helpful:

What's the relationship between [HTTP] channels, transactions and connections? E.g. is a connection a collection of transactions (i.e. keep-alive: one connection, many transactions)? Is a transaction a generalization of a connection? The other way around? The fact that other docs around the net seem to use the term "connection" and "transaction" interchangeably is kind of confusing too.

Thanks!


_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: From HTTP channels, transactions connections to TCP sockets - how does this all come together?

Boris Zbarsky
On 9/8/12 3:17 AM, [hidden email] wrote:
> What's the relationship between [HTTP] channels, transactions and connections?

My understanding, which may not be correct.

An HTTP connection corresponds to an actual TCP connection.

An HTTP transaction corresponds to an HTTP request/response pair.
Multiple transactions can happen on the same connection, either one
after another with keep-alive.  I'm not sure how this all works with
pipelining, since an nsHttpPipeline implements both the connection and
transaction APIs....

An http channel is the representation of one HTTP transaction as exposed
to the rest of Gecko.

-Boris
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: From HTTP channels, transactions connections to TCP sockets - how does this all come together?

Patrick McManus
On 9/8/2012 3:40 PM, Boris Zbarsky wrote:

> On 9/8/12 3:17 AM, [hidden email] wrote:
>> What's the relationship between [HTTP] channels, transactions and
>> connections?
>
> My understanding, which may not be correct.
>
> An HTTP connection corresponds to an actual TCP connection.
>
> An HTTP transaction corresponds to an HTTP request/response pair.
> Multiple transactions can happen on the same connection, either one
> after another with keep-alive.  I'm not sure how this all works with
> pipelining, since an nsHttpPipeline implements both the connection and
> transaction APIs....
>
> An http channel is the representation of one HTTP transaction as
> exposed to the rest of Gecko.
>

that's all right. I would add that an http channel is a little bit more
than a protocol based http transaction. While the http transaction is
literally a request and response on the wire, the channel might deal
with a larger set of circumstances, such as a cache hit or it might be a
transaction plus the work of recording the data in the cache or handling
the redirect notifications, or authorization prompts, etc..



> -Boris
> _______________________________________________
> dev-tech-network mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-network

_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: From HTTP channels, transactions connections to TCP sockets - how does this all come together?

Eric H. Jung
On Sat, Sep 8, 2012 at 8:31 PM, Patrick McManus <[hidden email]>wrote:

> On 9/8/2012 3:40 PM, Boris Zbarsky wrote:
>
>> On 9/8/12 3:17 AM, [hidden email] wrote:
>>
>>> What's the relationship between [HTTP] channels, transactions and
>>> connections?
>>>
>>
>> My understanding, which may not be correct.
>>
>> An HTTP connection corresponds to an actual TCP connection.
>>
>> An HTTP transaction corresponds to an HTTP request/response pair.
>> Multiple transactions can happen on the same connection, either one after
>> another with keep-alive.  I'm not sure how this all works with pipelining,
>> since an nsHttpPipeline implements both the connection and transaction
>> APIs....
>>
>> An http channel is the representation of one HTTP transaction as exposed
>> to the rest of Gecko.
>>
>>
> that's all right. I would add that an http channel is a little bit more
> than a protocol based http transaction. While the http transaction is
> literally a request and response on the wire, the channel might deal with a
> larger set of circumstances, such as a cache hit or it might be a
> transaction plus the work of recording the data in the cache or handling
> the redirect notifications, or authorization prompts, etc..
>
>
cc: Sheppy

I've hacked away at this stuff for years but never seen the differences
between an HTTP connection, HTTP transaction, and HTTP channel (in
Gecko-terms) so precisely described. It would be awesome to put this on
MDC, including the corresponding interfaces of each. I'd be very willing to
do it if someone can point me to an appropriate place?

Eric
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network
Reply | Threaded
Open this post in threaded view
|

Re: From HTTP channels, transactions connections to TCP sockets - how does this all come together?

Christian Biesinger-2
On Sun, Sep 9, 2012 at 7:34 AM, Eric H. Jung <[hidden email]> wrote:
> I've hacked away at this stuff for years but never seen the differences
> between an HTTP connection, HTTP transaction, and HTTP channel (in
> Gecko-terms) so precisely described. It would be awesome to put this on
> MDC, including the corresponding interfaces of each. I'd be very willing to
> do it if someone can point me to an appropriate place?

I'll note that there's also
http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/README,
which attempts to explain some of this, though it's somewhat dated.

-christian
_______________________________________________
dev-tech-network mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-network