WCF custom datagram channel for devices and server
Hello,
I am new to WCF. I need help determining if WCF is the way to go for the architecture of a messaging system I am trying to implement. I have a server running .net and multiple devices which are running custom hardware and software written in C. I need to be able to send messages to the devices and for the devices to send messages to the server. Sometimes these messages will get a response or acknowledgment from device or server depending on the type of message. All the messages will be using a type of datagram protocol. So the packets could get lost and there needs to be a timeout and retry if this happens. Is WCF the way to go? Can WCF handle this scenario? What aspects of WCF do I need to use to implement such a system.? I have read the documentation and can't determine if it will work for this case.
Thanks,
Josh
Hi Josh,
WCF can support this scenario but that doesn't mean that it's necessarily the right tool for the job. WCF doesn't replace the role of sockets in the framework. If you feel that it would be easiest to build your app against the traditional network APIs, then go ahead and do that. If you want to use the nice WCF programming model for writing the application-level service code, then you can wrap the networking calls that you normally would use to send and receive messages inside a WCF transport.
The WSE TCP interop sample (http://msdn2.microsoft.com/en-us/library/aa717042.aspx) is an example of writing a WCF transport that's like this. WSE has a custom wire format on top of TCP/IP. The sample uses the normal socket classes to implement sending and receiving messages using the WSE wire format. This abstracts how send and receive works from the rest of the sample application.
- Nicholas
http://blogs.msdn.com/drnick/