User:Brahmana/Netwerk Docs/Connection Transaction Organization
There are two main classes which actually define the basic behavior of a Http Connection and a Http Transaction. They are:
- nsAHttpConnection
- 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:
- nsAHttpConnection
- nsHttpConnection -- This actually represents a connection. This is never accessed directly. The two things below act as wrappers to this one.
- nsConnectionHandle -- This is used for wrapping the connection when pipelining is not allowed.
- nsPipeline -- This is used for wrapping the connection when pipelining is allowed and is being done.
- nsAHttpTransaction
- nsHttpTransaction -- This is used when pipelining is not allowed.
- 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)?