I am writing a network applications to read data from a server. The problem I have encountered is that on abrupt termination of my program, the socket rtemains open so that the next time I execute the program it will return an "Inavlid operation in actual state" error 40020. I am testing on 2 pc´s connected via twisted net cable. I have reset the pc where the problem arose to no success, I have to reset both pc´s to make it work again. My questiosn are :
1. can anybody tell me how to fix this problem programatically?
2. Is there a feasible way to detect network cable remotion. I am using IsNetworkAlive and will return after a certain period cable is disconnected even thougfh they are connected.
3. Due to the abupt termination I also have problems with RegisterClass and UnregisterClass. The first returns an error 1410 (Class already registered) and when the unregisterclassw is executed it will return an error 87. So I can´t get past these problems.
Please help, I am going crazy!!!!!!
Thanks for your help,