Jayson B

Bear with me because we are new to WCF and have been going through documentation and samples trying to absorb as much as possible in a short amount of time (sound familiar). We would of course rather design this correctly from the start instead of learning later that there's a much better design.

We are working on designing a client server solution using WCF where we will have at most 20 clients calling the server with a requests using NetTcp. Because the server gathers the data in chunks and it can take some time to finish we want to make this an asynchronous call as well as allow the server return chunks of data at a time.

- It looks like the Duplex calls only allow for a single response from the server, so this option is out.
- We have considered creating an Endpoint on both the server and the client. When requesting data from the server the client would pass it's Endpoint information to the server. The server would then create a channel using the client Endpoint info and send responses to the
client in chunks.
- We have also considered using a pattern similar to reading data from a file where the client will request chunks of data from the server in multiple calls until it receives an EOF flag. This would need to be asynchronous as well. This would keep us from creating an Endpoint on
each client. I'm not sure if this is a benefit, but it's one less thing to do.
- Finally, what would be the best way to pass back the data. We've created a simple data container, which looks like a basic dataset and is decorated to allow serialization by WCF. It seems like it would be sufficient.

Again, any suggestions to get us on the right path earlier rather than later would be very much appreciated.

Thanks,
Jayson


Re: Windows Communication Foundation (Indigo) Need Asynchronous WCF design which allows for multiple responses (Callbacks)

Martin Petersen-Frey - MSFT

It sounds like duplex callbacks are exactly what you are looking for. Duplex callbacks allow a service to make multiple calls on a client over a sessionful channel for as long as that channel is open. A good description of this is at http://msdn.microsoft.com/msdnmag/issues/06/10/WCFEssentials/default.aspx. It's also doc'd at http://msdn2.microsoft.com/en-us/library/ms731064.aspx.