This is just a style convention that helps you avoid doing some thinking while writing custom channel classes. During the channel construction process, there's a flow of information from the binding (design time), through the channel factory and listener, and down to the channel (run time). The channel needs to know about the configuration changes that the user has made in setting up the binding. As we've seen before, there's some difficulty with storing this information outside the channel, so we can't rely on referencing the information indirectly through another object after creation. Here's the convention that we've sort of settled on in most of our channels.
When creating the channel factory or listener (jointly referred to as the channel manager), the constructor takes two arguments.
When creating the channel, the constructor takes as many arguments as it needs to pass all of the private data that was being stored in the channel manager. It can be helpful to group some of these arguments using a specialized interface if you need to pass around the same information to a lot of different places. The channel manager does not give the this instance to the channel normally. An exception is if you're using the ChannelBase class for your channel, which requires an instance of ChannelManagerBase. In that case, the channel manager gives its this instance to the channel solely for that purpose. The channel constructor takes that instance as a ChannelManagerBase rather than using a specialized type.
Next time: Mixed Mode Addressing
Angus, the bulldog has so taken over the house. At least, it's made us more popular with the neighbors.
This article covers some of the advanced topics that I left out of the earlier piece on configuring HTTP
Angus, the bulldog has so taken over the house. At least, it's made us more popular with the neighbors