I've been working with CSockets for several months now and mostly have things working, but am having an odd symptom occasionally while testing.
I'm using the Visual Studio IDE to do the testing. I've written a client program and a server program. I run both of them at the same time under Visual Studio and set the client program to make multiple connections to the server program to retrieve data from the server. It all works pretty well.
Except that occasionally it locks up. I can see that the client program is about to do the CSocket.Connect. The host program then successfully performs an Accept, sets up the necessary CArchives to receive the information (actually an identifier string that tells the host what data the client wants) from the client. The fact that the host has processed the Accept is a clear indicator that the client has completed the Connect, but the client actually never gets back from the call to Connect, so it never gets to the point in the code where it sends the identifier string to the host. So it locks up.
Since I'm running both the client and host on the same machine it means that it's time-slicing the processing of the two programs. It's almost as if, after handling the Accept in the host program, the operating system never gets around again to processing the client program.
Does this make sense? Is it possible that it's a timesharing problem on the machine and that the programs are actually OK?
I don't at present have a second machine so that I could run the host and client on separate machines.
Has anyone encountered such a problem? Is there a solution?
- Roger
