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. Socket funcions and IOCompletion port questions?

Socket funcions and IOCompletion port questions?

Scheduled Pinned Locked Moved C / C++ / MFC
question
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
    followait
    wrote on last edited by
    #1

    1. Does AcceptEx and ConnnectEx support IOCP? 2. Mswsock.h doesn't have a declare of ConnectEx, how can I use it? 3. If A sends a packet to B, then B receives it use in an IOCP method, but how does B know when to call WSAReceive? DO I have to use WSAAsyncSelect/WSAEventSelect at the same time?

    P 1 Reply Last reply
    0
    • F followait

      1. Does AcceptEx and ConnnectEx support IOCP? 2. Mswsock.h doesn't have a declare of ConnectEx, how can I use it? 3. If A sends a packet to B, then B receives it use in an IOCP method, but how does B know when to call WSAReceive? DO I have to use WSAAsyncSelect/WSAEventSelect at the same time?

      P Offline
      P Offline
      Peter Mares
      wrote on last edited by
      #2

      Hi, 1. Yes, and yes. 2. U should be using winsock2.h 3. IOCP sockets that support 'receiving data', should be in a constant state of 'being ready to receive data. Due to the nature of IOCP, the worker threads are the ones handling the events, so you don't want to use WASAsyncSelect/WSAEventSelect stuff. There are a couple of really good articles on CP for IOCP servers and sockets - you should have a look at them. Also, remember that if you have multiple buffers per socket (which you should have), you will not always be able to guarantee the sequence of partial packets received when you run on a multi-CPU box. Hope this helps a bit


      controlSHIFT [WinShareSpy] [Glossary Manager] [AfterThought Backup Lite] All good things were meant to be improved

      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