void TWebPgFetchEvent::OnError(const uint64& SockId, const int& ErrCd, const TStr& ErrStr){ Retries++; if (Retries<Fetch->GetMxRetries()){ OnGetHost(SockHost); } else { OnFetchError(TStr("Socket Error (")+ErrStr+")"); } }
void TWebPgFetchEvent::OnTimeOut(const uint64& SockId){ if (OppSockClosed){ OnFetchEnd(); } else { Retries++; if (Retries<Fetch->GetMxRetries()){ OnGetHost(SockHost); } else { OnFetchError("Timeout"); } } }
/*--------------------------------------------------- window procedure to process WinSock ---------------------------------------------------*/ LRESULT CALLBACK SNTPWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WSOCK_GETHOST: // get IP address OnGetHost(hwnd, wParam, lParam); return 0; case WSOCK_SELECT: // receive SNTP data OnReceive(hwnd, wParam, lParam); return 0; case (WM_USER + 10): // command to start SNTPStart(hwnd, (char*)lParam); return 0; } return DefWindowProc(hwnd, message, wParam, lParam); }