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. How to abort reading operation on blocking socket?

How to abort reading operation on blocking socket?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 3 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.
  • K Offline
    K Offline
    kotbegemot
    wrote on last edited by
    #1

    How to abort reading operation on blocking socket? WSAAsyncSelect doesn't work.

    V 1 Reply Last reply
    0
    • K kotbegemot

      How to abort reading operation on blocking socket? WSAAsyncSelect doesn't work.

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      What do you mean WSAAsyncSelect does not work? WSAAsyncSelect is a non-blocking I/O model. Kuphryn

      S 1 Reply Last reply
      0
      • V valikac

        What do you mean WSAAsyncSelect does not work? WSAAsyncSelect is a non-blocking I/O model. Kuphryn

        S Offline
        S Offline
        SLiDeR
        wrote on last edited by
        #3

        He means following situation. There are 2 threads. One thread sets the socket to blocking state and starts to receive data. Let the next recv() function blocks the socket. The second thread wants to terminate this operation. What should it do? Calling AssyncSelect() from the second thread doesn't set the socket back to non-blocking mode.

        K 1 Reply Last reply
        0
        • S SLiDeR

          He means following situation. There are 2 threads. One thread sets the socket to blocking state and starts to receive data. Let the next recv() function blocks the socket. The second thread wants to terminate this operation. What should it do? Calling AssyncSelect() from the second thread doesn't set the socket back to non-blocking mode.

          K Offline
          K Offline
          kotbegemot
          wrote on last edited by
          #4

          All is OK now. Sockets set back to non-blocking mode after a few seconds - use select()

          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