Postby A51Integrated » 17 Sep 2012, 15:25
Mobile devices are saddled with wireless connections, which are obviously far slower than wired ones. TCP messages are also verified transmissions - so if something happens to the packet (dropped) the system will re-attempt transmission until all packets are received on the other end and verified. Because of this, TCP is much slower than UDP - UDP doesn't verify successful transmission. So if you want to send a large number of messages to the server in a very short period of time, you're better off using UDP as apposed to TCP.
However, there is still client processing time and lag time that needs to be taken into account to process the response from each request. 100 messages in under a second is substantial - even for position updates in a race or first person shooter game. In this case, I would look at your messaging architecture to either compile more data into each message and/or reduce the number of messages to a number that is truly required by the application (I realize your code is for testing purposes, but real life scenarios rarely if ever have this type of message frequency).