Asynchronicity, OneWay, and WCF

I’ve recently encountered some confusion around the behavior of one-way operations in WCF that I’m going to try and clear up.  In particular, developers are under the impression that a one-way operation == a non-blocking call. However, this is not necessarily the case. A one-way operation means that we will call the underlying channel in […]

On the Wire with channel.Open()/Close()

I got a question the other day about what data goes on the wire when you Open(), Close(), or Abort() our various transport channels. Here are the details in a nutshell (all the comments about net.tcp apply to net.pipe, simply substitute “named pipe” for “socket”): HTTP Request (Client) Channels Open() — Nothing goes on the […]

What IP Address(es) do we listen on?

When listening on any socket-based protocol (http, net.tcp, UDP, SMTP, etc), there are ultimately two items that contribute to where we listen: IP Address and Port. Your port# is usually specified in the URI of your endpoint (see RFC 2396, section 3.2.2). If a port# is not specified then each URI scheme has the option […]

Building a "Composite" Transport

I’ve often written about how to write custom channels; transports in particular. In all of the examples I’ve given, the same transport is used for both sending and receiving messages (i.e. HTTP out, HTTP in). This parallelism fails in certain scenarios. For example, WS-Discovery defines a pattern where you send out a UDP Multicast probe […]

Protocol Channel Example: Chunking

In my quick PDC recap I promised to post Yasser‘s demo code. So before I digress: here is the code for a protocol chunking channel. There is a lot more refinement to be added in order to make this production-level, but it’s a great illustration of the power and flexibility of a layered channel model. […]

Channels 130: Configuration support

The final piece that we need to add to our Transport is configuration support. To expose our transport through config, we need to implement two configuration sections. Binding Element Extension Section The first class we add is to configure UdpTransportBindingElement. This is so that custom binding implementations can include udp. In UdpTransportSection we define our […]

Channels 120: Binding your Factories

Now that our Factories and Channels our built, we need to expose them to the Service/Proxy system. Channels fit into this system through the concept of a Binding. A binding represents the communication stack associated with a service endpoint. In essense, a Binding is a top-level container for a collection of BindingElements. Each binding element […]

Channels 110b: IListenerFactory

At the root of a service-side stack lives an IListenerFactory. When you add an Endpoint to a Service, its binding constructs an IListenerFactory stack which is responsible for receiving messages associated with that endpoint. In our sample code, IListenerFactory-related files include UdpListenerFactory.cs, UdpInputListener.cs, and UdpInputChannel.cs. UdpListenerFactory  UdpListenerFactory derives from ListenerFactoryBase. For addressing purposes, we implement […]

Channels 110a: IChannelFactory

Sorry for the radio silence, I was on holiday in Alaska. Now I’m back with extra vigor to continue our evolving tutorial. 🙂 NOTE: Source code for all of the files and functionality referenced in the next few posts is available here. At the root of a custom transport implementation is the creation of your […]

Channels 103: Addressing the World

The next step in our custom transport walk-through is to create our channel managers. This includes an IChannelFactory for our client side channels, and an IChannelListener for our service-side channels. Both IChannelFactory and IChannelListener derive from IChannelManager. IChannelManager is responsible for tracking channels that are created or accepted. IChannelManager also has a property to control […]