MCPcopy Create free account
hub / github.com/amule-project/amule / CheckForTimeout

Method CheckForTimeout

src/ServerConnect.cpp:455–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void 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
489bool CServerConnect::Disconnect()

Callers 1

OnCoreTimerMethod · 0.80

Calls 8

GetTickCount64Function · 0.85
CFormatClass · 0.85
eraseMethod · 0.80
IsSolvingMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetFullIPMethod · 0.45
GetPortMethod · 0.45

Tested by

no test coverage detected