Winsock send() stops working after a few uses
Posted on 2003-11-29
It seems I have ran into another problem with my client/server application.
Some background on my problem.
Im using Visual Studios C++
All Console Apps
I have a client that connects to a server. Right now the client sends a object to the server and the server prints out the objects values to its screen. Object and its attributes:
Example Message to server:
Ericka: I sent this message from the client.
Everything compiles and works nicely as its suppose to do. However after I send messages to the server 8 times, my server will no longer print out anymore messages. I have debugged the client and have verified that the PlayerObjs values are being updated before the client attempts to send the object.
Another strange thing is if I continue to try to send messages after the server stops printing them out on its console, the client stops printing out my message on the client console after the 16th attempt. If I close out the server application before the client application I get a
ERROR: Send failed...
message (on my client console) for each send attempt that didnt print out on the server side. I wrote the check for the ERROR message to let me know that a send was unsuccesful.
It looks to me that the send attempts are getting backlogged or something somehow and when I shutdown the server they then attempt to be sent to the server and I get a ERROR: Send failed message because it has lost connection. Why would the send()'s stop after only 8 times of sending data? This program is very small and simple so I dont see how the socket could be getting bottlenecked or something. Im very new to network programming. If anyone has any ideas on how to fix this I would be very grateful.
Thanks in advance.