User:Brahmana/Netwerk Docs/Connection Transaction Organization

< User:Brahmana‎ | Netwerk Docs
Revision as of 15:56, 17 July 2008 by Brahmana (talk | contribs) (created the page with two questions.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

There are two main classes which actually define the basic behavior of a Http Connection and a Http Transaction. They are:

  1. nsAHttpConnection
  2. nsAHttpTransaction

Ideally, I would have expected these two be two interfaces. Because that's what they are, "Interfaces to two things, viz a connection and a transaction". But for some reason these were made abstract classes. Probably to avoid usage from JS. Then again these could be made non-scriptable interfaces. Now as you know, I seriously do not know why these are abstract classes and not interfaces.

Going ahead, there are multiple implementations of these two behavioral classes. Some of which I have come across are:

  1. nsAHttpConnection
    1. nsHttpConnection -- This actually represents a connection. This is never accessed directly. The two things below act as wrappers to this one.
    2. nsConnectionHandle -- This is used for wrapping the connection when pipelining is not allowed.
    3. nsPipeline -- This is used for wrapping the connection when pipelining is allowed and is being done.
  1. nsAHttpTransaction
    1. nsHttpTransaction -- This is used when pipelining is not allowed.
    2. nsPipeline -- This is used when pipelining is allowed and is being done.

Now I do not know whether these implementations have something extra apart from helper methods. That is a question for necko folks.

Q1. Do the concrete implementations have a lot more things than what is present in the abstract classes? If so what sort of stuff? (Examples at a high-level)


There is no 1-to-1 mapping between a transaction and a connection.

Q2. What all things are logically represented by a transaction (a nsHttpTransaction or a nsHttpPipeline object)?