Just Exactly What You Asked For

When implementing a transport or layered channel class the marker used to indicate that your class is a channel is to implement the IChannel interface. Therefore, all channels will implement one of the known channel shapes: IInputChannel, IOutputChannel, IDuplexChannel, IRequestChannel, or IReplyChannel (optionally you might use the sessionful variant of one of these channel shapes…


Advanced Windows Debugging

Channel 9 has put up a new video that mostly plugs the Advanced Windows Debugging book by Mario Hewardt and Daniel Pravat. I recommend the book for someone that needs to debug difficult issues dealing with native resources. For most people working with WCF this is never really a concern, but custom transport authors will…


Building with Encoders

The basis of a channel stack is that there is a series of objects that share a common interface for communication. This leaves message encoders with something of a problem as the primitive operations for encoding and decoding messages are different than the primitive operations for sending and receiving messages. Message encoders avoid this problem…


Best Practice for Channel Shapes

The hierarchy of channels derives from the single interface IChannel. By itself, IChannel is not particularly interesting because it doesn’t introduce any new methods for communication. Each channel shape, such as IInputChannel or IDuplexSessionChannel, has its own interface derived from IChannel that describes the capabilities and semantics of the channel. When you write a channel,…


Shutting Down a Channel

A common corner-case in programming is what happens when multiple operations are attempted at the same time. One way to avoid the troubles of this corner-case is to simply prohibit having multiple operations occur simultaneously. However, it typically isn’t possible to make this exclusion work in a universal fashion. Consider an object that prevents having…


Always Begin with Accept

Inside a service, there’s a fundamental loop running whose job it is to create channels for the incoming connections to the service. There’s another loop that runs later, which you may argue is equally fundamental, that reads messages from each channel to determine the actual service invocation. Every one of these service requests though was…


Live from TechEd Day 2

I gave a chalk talk on channel development in the afternoon yesterday. I did a huge experiment for the second-half of the talk, which was to write a custom channel from scratch for the audience. That’s the kind of theater that you can pull off in a chalk talk but not a regular breakout session….


Custom Channel Development

I’ll be giving another talk on channel development for WCF this year at TechEd. Due to the selection of sessions, there’s really only one good lead-in talk and it’s currently scheduled for later in the week. That means that I’ll be spending more time on background material than I normally would. However, if you have…


Writing Channel Manager Essentials

Once you’ve obtained a channel manager from the binding element, you have the first object that is usable for network communication. Although the two kinds of channel managers, channel factories and channel listeners, share many of the same methods, the use of those methods tends to be quite a bit different. I’m going through just…


Writing Binding Element Essentials

We’re back to the channel development series for another pair of days. When I left off, I promised to talk a bit about writing binding elements and channel managers. Today’s article is about writing binding elements and tomorrow’s article is about writing channel managers. These articles expand on the checklist items for the steps you…