I am developing an FTP-like program for uploading a large number of small files to the Xbox 360 devkit (which uses Winsock) and porting it to Playstation3 (also devkit and using linux AFAIK). The program uses BSD-style sockets (TCP). Both programs communicate with the same server, loading the same data. The program iterates over all files in a loop as follows:
for each file
send (retrieve command)
send (filename)
receive (response)
test response
receive (size)
receive (data)
When implementing the Xbox 360, the entire download takes 1:27, and the time between the last sending and the first receiving takes about 14 seconds. It seems to me quite reasonable.
The Playstation3 implementation takes 4:01 for the same data. The bottleneck seems to be between the last dispatch and the first receipt, which takes 3:43 of that time. Network and disk times are significantly shorter than the Xbox 360.
Both of these devkits are on the same switch as my computer that is serving the file, and there is no other traffic on this switch.
I tried to set the TCP_NODELAY flag, which did not significantly change the situation. I also tried to set SO_SNDBUF / SO_RCVBUF to 625 KB, which also did not significantly affect the time.
I assume the difference between implementations of the TCP / IP stack between Winsock and linux; Is there a socket option that I could set to make the linux implementation more like Winsock? Is there anything else that I don't take into account?
The only solution is to rewrite it so that it sends all file requests together and then receives them all.
Unfortunately, Sony's implementation does not have the TCP_CORK option, so I cannot say if this is the difference.
networking sockets winsock xbox360 playstation
arolson101
source share