Question

My app sends data to a Server using a TidTCPClient. The Server uses a TidTCPServer. All works fine and I am now trying to handle unexpected situations.

When I disconnect the network cable between server and client, and then try to close the client, it waits for a long time, until it finally closes:

TCPClient.IOHandler.InputBuffer.Clear;
TCPClient.Disconnect;
TCPClient.Free;

TCPClient.Free is the place where it waits. This is sometimes 30 seconds, sometimes even longer.

Is there a way to terminate a TCPClient immediately, no matter what it is doing at that moment?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top