Indigo Listener Architecture

I was getting a little interested in learning more about how the Indigo/WCF transport listener architecture works. This is what I found so far:


The center of this is the TransportListenerFactory. Its inheritance tree can be found on MSDN but here is a quick overview:


System.Object
   System.ServiceModel.Channels.CommunicationObject
      System.ServiceModel.Channels.ChannelManagerBase
         System.ServiceModel.Channels.ListenerFactoryBase
            System.ServiceModel.Channels.TransportListenerFactory
               System.ServiceModel.Channels.ConnectionOrientedTransportListenerFactory
                  System.ServiceModel.Channels.NamedPipeListenerFactory
                  System.ServiceModel.Channels.TcpListenerFactory
               System.ServiceModel.Channels.HttpListenerFactory
               System.ServiceModel.Channels.MsmqListenerFactoryBase
               System.ServiceModel.Channels.PeerListenerFactory


Now let’s look at a self-hosted example: You first create your ServiceHost and then decorate it with the endpoint and binding information. Custom bindings are most interesting, since you can see a little of what’s going on under the cover. Encoding and Transport Channels are required, and you need to add your transport binding last. Also you MUST properly configure the EndpointListener; in particular you need to select the right transport protocol prefix (e.g. http:// for HTTP or net.tcp:// for SOAP over TCP). The EndpointListeners themselves point (Factory property) to the transport factory.


It seems reasonable to assume that the relevant optimizations (e.g. connection multiplexing, pooling) are implemented in the TransportListenerFactory class which is abstract.


Another guess on my part is that I expect that the HTTP listener factory has some special implementation, since it needs to address IIS6 hosting and self-hosted environments.

Leave a Reply

Your email address will not be published. Required fields are marked *