Reputation: 4640
I am looking for a solution to push event from my server to clients which will be Android, iOS and Desktop(web) users.
I have seen quite a few posts on Parse, Amazon SNS and Google Cloud Messaging but non of them mention the speeds and most common applications for them or comparison to simple TCP stream or websockets?
I need to have up to 50 events/second bi-directonal throughput per client (¬1kb per event) with max 150ms latency.
What are disadvantages of using just a TCP stream of events versus websockets versus SNS/Parse/GCM?
Upvotes: 6
Views: 280
Reputation: 5184
Push Notifications (GCM and APNs)
PROS: You can reach the device even if the client application is not running.
CONS: Low throughput; high latency
Raw TCP
PROS: High throughput; low latency; bidirectional
CONS: Doesn't pass through typical proxies and firewalls; needs the client app to be running
WebSockets
PROS: High throughput; low latency; bidirectional; passes through firewalls
CONS: Not all proxies already support them; needs the client app to be running
In additions, there are also HTTP Streaming and HTTP Long Polling.
Upvotes: 6
Reputation: 5639
here you can find some benchmarks: http://blog.arungupta.me/rest-vs-websocket-comparison-benchmarks/
this more technical question may help you or others too: What is the fundamental difference between WebSockets and pure TCP?
Quote from the accepted answer:
It's easier to communicate via TCP sockets when you're working within an intranet boundary, since you likely have control over the machines on that network and can open ports suitable for making the TCP connections.
Over the internet, you're communicating with someone else's server on the other end. They are extremely unlikely to have any old socket open for connections. Usually they will have only a few standard ones such as port 80 for HTTP or 443 for HTTPS. So, to communicate with the server you are obliged to connect using one of those ports.
Upvotes: 2
Reputation: 71
you can try a SignalR.
ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications
one of my colleague have used this library for web, window, android, mac etc for real-time messaging.
Upvotes: 3