I have a Silverlight 4 application that uses WCF duplexing by creating a callback to the client. From the client, I have a method that retrieves all rows from a database (not really, but for this example). Each row is sent to the client using the callback. I need to figure out how to abort this process once started. For example, say I'm tired of seeing all the rows from this table being scrolled by on my screen. I want to see the rows from another table. How do I stop the first action while in the middle of it?
I thought I could just create a new operation on the server to abort processing, but this won't do anything with what's already been sent through the callback and waiting to be picked up by the client.
I am looking for a way to guarantee that once the new search starts, I don't have any old data laying around that will get picked up by the client. Does anyone have any idea on the best way to accomplish this?
It’s funny – before using duplex services, my problem was that I could not get data fast enough. Now that I am using duplexing, I can’t get it turned off!