| 453 | } |
| 454 | |
| 455 | void CServerConnect::CheckForTimeout() |
| 456 | { |
| 457 | uint64 dwCurTick = GetTickCount64(); |
| 458 | |
| 459 | ServerSocketMap::iterator it = connectionattemps.begin(); |
| 460 | while ( it != connectionattemps.end() ){ |
| 461 | if ( !it->second ) { |
| 462 | AddLogLineN(_("ERROR: Socket invalid at timeout check")); |
| 463 | connectionattemps.erase( it ); |
| 464 | return; |
| 465 | } |
| 466 | |
| 467 | if ( dwCurTick - it->first > CONSERVTIMEOUT) { |
| 468 | uint64 key = it->first; |
| 469 | CServerSocket* value = it->second; |
| 470 | ++it; |
| 471 | if (!value->IsSolving()) { |
| 472 | AddLogLineN(CFormat( _("Connection attempt to %s (%s:%i) timed out.") ) |
| 473 | % value->info |
| 474 | % value->cur_server->GetFullIP() |
| 475 | % value->cur_server->GetPort() ); |
| 476 | |
| 477 | connectionattemps.erase( key ); |
| 478 | |
| 479 | TryAnotherConnectionrequest(); |
| 480 | DestroySocket( value ); |
| 481 | } |
| 482 | } else { |
| 483 | ++it; |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | |
| 489 | bool CServerConnect::Disconnect() |
no test coverage detected