0

I'm trying to have 100 Android devices that display text string based on a server parameter. When the server has the text changed from "Hello World" to "Everything Changed" I want all 100 android devices to update simultaneously and ideally instantly as soon as the change happens.

It runs on an isolated LAN so C2DM isn't feasible and polling every second seems rather traffic heavy (especially if there are 1000 devices later). Are there any recommendations on how to move from polling to pushing or at least making this scalable?

I've been considering just keeping the connection open and the server returns content only when it changes but worried about timeout issues and PHP's capability of handling 100's of concurrent connections... Any pointers or advice to try?

sradforth
  • 2,176
  • 2
  • 23
  • 37

1 Answers1

1

You should not pull. If you are in private networks, and amount of devices is limited, you better keep tcp sockets opened, and send data from server to client via opened socket.

But you must understand what are you doing.

So read following:

1) to understand how many connections can be opened and is it enough for your needs How many socket connections possible?

2) if you have a lot of devices, I mean more than thousand, you may failed on serverside. To not failed you must read about async io http://en.wikipedia.org/wiki/Asynchronous_I/O and some other found in the Net. and async io in php Can PHP asynchronously use sockets?

Community
  • 1
  • 1
logcat
  • 3,435
  • 1
  • 29
  • 44