| 965 | } |
| 966 | } |
| 967 | static void* ExecServerThread(void* param) { |
| 968 | BindToSocket(0); |
| 969 | SetHighestThreadPriority(); |
| 970 | TUdpHttp* pThis = (TUdpHttp*)param; |
| 971 | pThis->Host = CreateUdpHost(pThis->Socket); |
| 972 | pThis->HasStarted.Signal(); |
| 973 | if (!pThis->Host) { |
| 974 | pThis->Socket.Drop(); |
| 975 | return nullptr; |
| 976 | } |
| 977 | NHPTimer::GetTime(&pThis->PingsSendT); |
| 978 | while (pThis->KeepRunning && !PanicAttack) { |
| 979 | if (HeartbeatTimeout.load(std::memory_order_acquire) > 0) { |
| 980 | NHPTimer::STime chk = LastHeartbeat.load(std::memory_order_acquire); |
| 981 | double passed = NHPTimer::GetTimePassed(&chk); |
| 982 | if (passed > HeartbeatTimeout.load(std::memory_order_acquire)) { |
| 983 | StopAllNetLibaThreads(); |
| 984 | fprintf(stderr, "%s\tTUdpHttp\tWaiting for %0.2f, time limit %0.2f, commit a suicide!11\n", Now().ToStringUpToSeconds().c_str(), passed, HeartbeatTimeout.load(std::memory_order_acquire)); |
| 985 | fflush(stderr); |
| 986 | #ifndef _win_ |
| 987 | killpg(0, SIGKILL); |
| 988 | #endif |
| 989 | abort(); |
| 990 | break; |
| 991 | } |
| 992 | } |
| 993 | pThis->Step(); |
| 994 | pThis->Wait(); |
| 995 | } |
| 996 | if (!pThis->AbortTransactions && !PanicAttack) |
| 997 | pThis->FinishOutstandingTransactions(); |
| 998 | pThis->Host = nullptr; |
| 999 | return nullptr; |
| 1000 | } |
| 1001 | ~TUdpHttp() override { |
| 1002 | if (myThread.Running()) { |
| 1003 | KeepRunning = false; |
nothing calls this directly
no test coverage detected