The quick way to transform an ASP.NET WCF service into a Comet-style one, with long-polling:
- read this article and get the files
- replace your WCF calls with the ashx Comet handler, keeping the params in the querystring
- route the parameters to CometAsyncResult
- in CometAsyncResult have a dictionary cache from params to results
- when you need to push the result, compare the cached response with the newly-computed one, and *wait* (return null) if it's the same (long-polling here as the Comet handler will delay the response until timeout)
- use a random session key as an extra WCF parameter so the first response is always sent to the client
There's still some issues I'm investigating related to parallel normal WCF calls not being answered, to be continued ...