I have an async WCF service implementation and I want to detect when the client aborts the connection during a WCF method call.
Basically, this is what I want:
- Client calls WCF method
- Server begins processing the request asynchronously
- Client aborts the connection (or the connection fails for whatever reason)
- Server should be notified that the client aborted the connection
Is this possible?
This is for a long-polling implementation. Alternatively, can the server make sure that the client received the response successfully? If it didn’t, the response should be saved for the next poll request.
I don’t know any reliable way of knowing that client is connected or not. See this,this and this
Some of the alternative suggested are to use Duplex channels or use Queues. A Queue based solution would have server posting response to queue and client picking those responses from the queue. The queue can be implemented in MSMQ, DB, Azure.
Thanks