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. IOCP goes wrong?

IOCP goes wrong?

Scheduled Pinned Locked Moved C / C++ / MFC
sysadmintestingbeta-testinghelpquestion
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.
  • H Offline
    H Offline
    huqian2002
    wrote on last edited by
    #1

    I am writting a C/S program based by Socket and IO completion. I use CreateIoCompletionPort and GetQueuedCompletionStatus to build and get the connected socket. The Server program goes well when it is built. I also built a client for testing server.But a problem comes. If I use one client to connect the server, everything is fine. IF I use two more client to connect the server at the same time, the server handle them one by one.It doesn't handle them synchronously as I expected. Does anyone know the reason. Anyone is so kind to replay me? Thanks. aaa

    A G 2 Replies Last reply
    0
    • H huqian2002

      I am writting a C/S program based by Socket and IO completion. I use CreateIoCompletionPort and GetQueuedCompletionStatus to build and get the connected socket. The Server program goes well when it is built. I also built a client for testing server.But a problem comes. If I use one client to connect the server, everything is fine. IF I use two more client to connect the server at the same time, the server handle them one by one.It doesn't handle them synchronously as I expected. Does anyone know the reason. Anyone is so kind to replay me? Thanks. aaa

      A Offline
      A Offline
      Anand Paranjpe
      wrote on last edited by
      #2

      u gave the answer in ur question!! read it carefully U will get the key!! The chosen One :)

      H 1 Reply Last reply
      0
      • A Anand Paranjpe

        u gave the answer in ur question!! read it carefully U will get the key!! The chosen One :)

        H Offline
        H Offline
        huqian2002
        wrote on last edited by
        #3

        Really? Sorry, i have tried a lot. But it isn't improved. I am locked by the it. Can u tell the detail of the key ?

        1 Reply Last reply
        0
        • H huqian2002

          I am writting a C/S program based by Socket and IO completion. I use CreateIoCompletionPort and GetQueuedCompletionStatus to build and get the connected socket. The Server program goes well when it is built. I also built a client for testing server.But a problem comes. If I use one client to connect the server, everything is fine. IF I use two more client to connect the server at the same time, the server handle them one by one.It doesn't handle them synchronously as I expected. Does anyone know the reason. Anyone is so kind to replay me? Thanks. aaa

          G Offline
          G Offline
          geo_m
          wrote on last edited by
          #4

          hmm, unless you have 2+ CPU box, it will handle them always synchronously. IOCP only can help somehow masquerade it. :) Checklist for the very beginning - are your sockets initialized as OVERLAPPED? - are there more threads waiting in GetQueuetCompletionStatus? - what about the return codes from WSASend/FileWrite, are they correct? - is the problem while accepting the clients, or while communicating?

          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