|
We are creating a chat client application where we need to push messages to mobile clients.
No we have WCF service and client is requesting service every 3 minutes.
Is there a way we can use WCF to push data to clients over HTTP?
|
|
|
|
|
You need to probably take a look at Duplex Services - see this blog[^]. Apart from this you can read more about these type of services on msdn.
|
|
|
|
|
nitin_ion wrote: Is there a way we can use WCF to push data to clients over HTTP?
There is no way to push over HTTP full stop, never mind with WCF. HTTP is based on a request/response model so you can only send data in response to a request made by the client.
|
|
|
|
|
That's not entirely correct. It is possible to establish a polling duplex HTTP connection. You can find details here[^] on HTTP push.
|
|
|
|
|
Most of those are essentially faking a push. Re-using a connection would count but I didn't think the browser/service client would accept a second response within the same connection if it hadn't requested it.
|
|
|
|
|
And this is why I was careful to say a Duplex connection - so that the client knows that the response will be left open.
|
|
|
|
|
Push is evil, don't use it.
Always use polling.
|
|
|
|
|
Yep.
And like extra worse for a chat mobile application.
|
|
|
|
|
For a web service, yes. There are other scenarios where that's definitely not the case though (when the speed of update to clients is critical and the number of clients relatively low).
|
|
|
|
|
BobJanova wrote: There are other scenarios ...
Never for a "chat" service. That means humans. And with a low number even less point.
|
|
|
|