Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ASSERT(pState->m_hSocketWindow != NULL); When trying to close in the same thread Socket Was Created

ASSERT(pState->m_hSocketWindow != NULL); When trying to close in the same thread Socket Was Created

Scheduled Pinned Locked Moved C / C++ / MFC
design
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • F ForNow

      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

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      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
      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups