Josh
Josh

Reputation: 13828

using UDP protocol with WCF

Which binding should I use to make my WCF application communicate through UDP instead of TCP?

Can someone point me to the right direction so that I could use UDP with WCF?

Thanks

Upvotes: 10

Views: 6182

Answers (3)

Mike Atlas
Mike Atlas

Reputation: 8231

This is rather long winded, but looks comprehensive enough to help you get started. The majority of the article covers how to write your own UDP transport, and at the bottom it ties it in to WCF services.


Edit, Jan 2016 (5 years later): Link updated to a mirror of the same archive (confirmed via Archive.org's Wayback Machine mirror copy of the URL). A quick search shows there's a lot more potential native support and options available in newer .NET WCF for doing UDP. I no longer work in .NET technologies so others may find the original answer to be antiquated or obsolete, and wish to research newer methods.

Upvotes: 11

Arsen Zahray
Arsen Zahray

Reputation: 25337

Here's microsoft's take on the problem;

As far as I personally am concerned, http binding is pretty useless, and no one would ever use it, if it wasn't the default example binding. Theoretically it could be used for interoperability with other platforms. In practice it does not work out. Also, if you want to implement callback functionality, wsDualHttpBinding sucks big time and is going to cause you a lot of headache later on.

UDP binding is very specialized and you'll have to do some additional work to incorporate it into your app.

This leaves TCP, which is the binding I recommend for most purposes.

Upvotes: -2

AaronLS
AaronLS

Reputation: 38394

I believe you will have to write a custom transport to accomplish this. There is no builtin UDP support that I know of, except maybe for multicasting. Probably because TCP gives you certain guarantees about how a message is delivered that UDP lacks.

Upvotes: 1

Related Questions