ASSERT(pState->m_hSocketWindow != NULL); When trying to close in the same thread Socket Was Created
-
Hi I have CAsyncScoket Class In CwinThread (UI) I know all the notification are done in the Context Of the MainThread When I do get notification from lets say a OnSend I have the Threadid in the CAsynSocket class and Do A PostThreadMessage to the thread to do the send However I am trying to Close the Scoket in the same thread I created it All the while whether in the main thread or CwinThread the m_hSocket value is the same
-
Hi I have CAsyncScoket Class In CwinThread (UI) I know all the notification are done in the Context Of the MainThread When I do get notification from lets say a OnSend I have the Threadid in the CAsynSocket class and Do A PostThreadMessage to the thread to do the send However I am trying to Close the Scoket in the same thread I created it All the while whether in the main thread or CwinThread the m_hSocket value is the same
Without seeing your code this can't be answered. But some possible reasons are:
- The socket has been closed already
- The function is called from another thread
- The socket has been detached
- You have a statically linked MFC application, created the socket in a secondary thread, and did not call
AfxSocketInit
in that thread