Re: Slow socket performance
Quote:
Originally Posted by
Pharis
If I compile and run the C++ server code on a friend's computer (we're both using Visual Studio 2008), it works perfectly.
Are you running a debug version or a release, optimized version of the program? It must be a release version for any further analysis of any slowdown -- in other words, the program must be able to be run a machine that does not have Visual Studio installed.
Regards,
Paul McKenzie
Re: Slow socket performance
Hi Paul,
Thanks for the reply! I have also tried compiling a release version with full optimization and running it on a different machine, and it works fine there. Running a release build on my workstation results in the same poor performance.
Thanks,
-Pharis
Re: Slow socket performance
Might be related to gracefull closure of the sockets and TCP states (TIME_WAIT etc)
Use the netstat command to check for this.
Compare the netstat results with the C# server.
Perhaps on your devpc, "incomplete" socket shutdowns accumulate.
Hope this helps.
Re: Slow socket performance
Hi,
That what I thought at first, too.. so I rebooted the machine and started the server up fresh. The problem still occurs on the very first connection.
Thanks!
-Pharis
Re: Slow socket performance
I'd first check with a packet sniffer that the data actually leaves the server properly, then I'd concentrate on the receive part of the client. Since the system works fine locally but not over the Internet it may have something to do with the server packet being split up into multiple packets by the time it reaches the client. In that case it takes multiple calls to recv() to be fully received. Check that your client can can cope with this.