NightMan Гость
|
Добавлено: Сб Мар 30 2002 04:42 Заголовок сообщения: CAsyncSocket: debug assertion failure, line 512 in sockcore.cpp |
|
|
My program has an array of CAsyncSocket variables. On start I set timer for every socket[i], using socket index as eventID: theApp.m_pMainWnd->SetTimer(i, TimeOut, OnTimer); then call connect for them. In OnTimer callback function I do the following: socket[i].Close(); socket[i].Create(); socket[i].Connect(Host,Port); All notification events hadlers (OnConnect, OnSend, OnReceive) are not overloaded by me.
This is a fragment of sockcore.cpp where the assertion fails: pSocket = CAsyncSocket::LookupHandle((SOCKET)wParam, FALSE); if (pSocket == NULL) { // Must be in the middle of an Accept call pSocket = CAsyncSocket::LookupHandle(INVALID_SOCKET, FALSE); ----> ASSERT(pSocket != NULL); pSocket->m_hSocket = (SOCKET)wParam; CAsyncSocket::DetachHandle(INVALID_SOCKET, FALSE); CAsyncSocket::AttachHandle(pSocket->m_hSocket, pSocket, FALSE); } In the next line I have an access violation. What could be wrong here? Is this MFC to blame? I use MS VC++6.0 Just in case, I added some corrections, proposed in Q139692 article of MSDN, but it doesnt help. |
|