We are designing a system with a PC base station and 100 Android mobiles communicating over WiFi. They will use XLM-RPC as the method of mobile to base station communication. However, sometimes the base station needs to broadcast a message to all mobiles. Should we use "http server push" for this, ie, have the base station leave the connections open to all the mobiles? Is there a better way? Publish-subscribe is possible, but doesn't seem mature on Android yet.
A:
Why do not in fact use a real broadcast? Let the station to send the message to a broadcast address and the net layer will do the job for you.
Of course this solution can be good if you can switch to an XML-RPC over udp.
Otherwise you have to select() a pool of sockets opened, updating every client you have to notify.
The first approach being very very light in resource load, the last being more affordable.
Its all a balance between this two opposites.
AlberT
2010-04-02 13:36:23
Thanks, that's an interesting idea. Though, maybe broadcast was the wrong word because we want guaranteed delivery.
BenYL
2010-04-05 13:12:49