Write an ActionScript program has been more than 4 years, and the program writes a Socket is still not much until this year, using Flash to write PocketPC's programs to really use the XMLsocket client built into the flash, because the AS parsing XML is very slow, but PocketPC is slower, so although xmlsocket is used, it is actually transmitting strings with the server.
At first, because the Socket server program restrictions, the Socket server queried the database, only one piece of data returned, so that when the data in the database, the transfer speed became a big problem (in Injoym300, 100 data About 10s can be delivered to the completion), this speed is obvious that the user is unacceptable, not to mention 100 data or non-extra data, and the design indicator is 1000 data, and it is much greater than 100 data.
From the above situation, I think, the main reason for the query speed may be too many requests, 100 records need to send 100 requests by the Socket client, and the Socket server returns 100 records, I imagine Most time spent on mutual requests, this is the main bottleneck, which is slow, if you can change the Socket server to make a request, all returned, can save most of the time, I even think that when data is greater than 100 At the time, it can save more than 10 times (because the HTTP data accessed with flashremoting is very fast, the same is below the PPC).
So under the request of me again, the designer of the Socket server converts socket to a client request, and returns data multiple times, and returns the amount of data with client control. After getting a new Socket server, I immediately tested it. It was found that it did not like the same as I imagined. At the same time, it did not change it quickly. Later, I was waiting for me to compare with a single data, I found an unexpected result, that is, multiple returns to be slower than each time. Many, even more, the more the speed is slower. Below is a part of the test data:
Single Return to a record: 100 ~ 120ms multiple returns: 100 ~ 120ms
Single strip returns 8 records: 2s left and right multiplexes return 8 records: 5s
Single Back 100 Record: 10s left and right multiplexes return 100 records:> 36s
For the results above, I queried Flash's help files, and I went online to search, I didn't find the relevant introduction.
It is temporarily concluded from the above data, which is the increase of the amount of xmlsocket in the transfer (accepted) (at least in the PPC, the Flash on the PC has not been tested yet. This will be like this), Flash's Socket client is more suitable for the interaction of high-speed low data volume, may not always interact with information
Of course, the conclusion above is not necessarily correct. With the further understanding of Flash's XMLsocket, I believe that the true cause will be found, and it can explain the above phenomenon.