If I understand your original problem correctely based on this statement how i could know that sendData is finished so i can press cmdSend again you are really trying to connect to the same host more than once which you cannot do unless the host has closed his socket. You do not want to press cmdSend again. The first time you press it, it requests a connection and in your _Connect() event the connection is completed. That's it. Don't do it again. However, like I said, if the host closes his socket then you can do it again and you will know that the host has closed his socket in your Winsock1_Close event.




Reply With Quote