Hi,
I have a TDI driver which basically communicates over TCP to server.I have registered a callback “ClientEventDisconnect” which gives me a callback when a disconnect is encountered. Now my driver start up at BOOT time and during boot this callback is evoked. However when i examined the server side, it clearly shows that the server has not issued a disconnect on the connection. Which means that something on the local stack has issued a disconnect to my driver.
After encountering this disconnect , i proceed to do a local TCP disconnect using the TDI_DISCONNECT request. This request fails with status STATUS_CONNECTION_INVALID. Then i try to connect to the same server using the same IP/PORT settings. However every connection attempt i try fails with status STATUS_IO_TIMEOUT.
Now i analyzed the network traffic and found that the previous TCP connection between the two machines is still active. Not only that for every connection attempt i try to make, the local TCP stack sends SYN to the server. Now the server replies with ACK instead of a SYN-ACK. My driver attempts to connect in a loop as i need to resume as soon as possible. The above cycles continue infinitely with no successful connection made. The TCP connection never resets.
This reconnection code works well for following scenarios
- Server process is killed and restarted
- Remove network cables i.e disrupting connection lines. etc
Now i dont know wht else can be done so that the local TCP resets the connection and starts afresh. Can anybody help me out ??