Avoid long hangs on disconnect if the connection is disrupted.

This commit is contained in:
Stephen Heumann 2016-09-21 21:23:06 -05:00
parent 5c1fc77f9b
commit e15038f3ec

View File

@ -670,10 +670,15 @@ void UnTuneMarinetti (void) {
* CloseTCPConnection() - Close the TCP connection to the host
**********************************************************************/
void CloseTCPConnection (void) {
long stopTime;
TCPIPCloseTCP(hostIpid);
WaitCursor();
DisplayConnectStatus("\pClosing VNC session...", FALSE);
stopTime = TickCount() + 5 * 60;
do {
if (TickCount() >= stopTime)
TCPIPAbortTCP(hostIpid);
TCPIPPoll();
TCPIPLogout(hostIpid);
} while (toolerror() == terrSOCKETOPEN);