DWORD WINAPI ClientIOCP::WorkerThread(LPVOID lpObject) { SocketClient client; char* reply; int res = client.Connect(8085); client.Send("This is a test\n", reply); return 1; }
DWORD Worker::ClientConnThreadProc(void* p) { Worker* pThis = (Worker*)p; bOrderEnd = false; int nError; pThis->m_pSocket = new SocketClient(); SocketClient* pSocketClient = (SocketClient*)pThis->m_pSocket; //TODO: move this in Send / Receive Files Thread //pThis->m_dataTransferer.SetSocket(pThis->m_pSocket); nError = pSocketClient->Create(); if (nError) { DisplayError(nError); bOrderEnd = 1; goto final; } SendMessage(MainDlg::m_hStatusText, WM_SETTEXT, 0, (LPARAM)L"Connecting to the server..."); try_again: nError = pSocketClient->Connect(14147);//was: 14148 if (nError && !bOrderEnd) { if (nError == WSAECONNREFUSED) {Sleep(200); goto try_again;} if (nError != WSAETIMEDOUT) { DisplayError(nError); bOrderEnd = 1; goto final; } else {