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 do I receive data after an completed AcceptEx operation?

How do I receive data after an completed AcceptEx operation?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 1 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.
  • B Offline
    B Offline
    bond006
    wrote on last edited by
    #1

    Hello, I want to receive data after an AcceptEx() call. A brief overview: 1. I listen on a port and receive data with the buffer I've passed to AcceptEx(). 2. When there is incoming data I process the data and send a return packet. 3. Now I wan't to receive data from the same connection again. I tried to use WSARecv() on the socket, but everytime I use WSARecv() I get an error with the error code 10014 (The system detected an invalid pointer address in attempting to use a pointer argument in a call). When I create a new socket with the socket(), bind(), listen() accept() procedure and pass it to the WSARecv() function I have no problem in calling WSARecv(), but I wan't to receive data from the socket on which I sent data. Can I use AcceptEx(), send() and then WSARecv() in this order??? How would you do this? ----------------- Thank you for your attention, bond006

    B 1 Reply Last reply
    0
    • B bond006

      Hello, I want to receive data after an AcceptEx() call. A brief overview: 1. I listen on a port and receive data with the buffer I've passed to AcceptEx(). 2. When there is incoming data I process the data and send a return packet. 3. Now I wan't to receive data from the same connection again. I tried to use WSARecv() on the socket, but everytime I use WSARecv() I get an error with the error code 10014 (The system detected an invalid pointer address in attempting to use a pointer argument in a call). When I create a new socket with the socket(), bind(), listen() accept() procedure and pass it to the WSARecv() function I have no problem in calling WSARecv(), but I wan't to receive data from the socket on which I sent data. Can I use AcceptEx(), send() and then WSARecv() in this order??? How would you do this? ----------------- Thank you for your attention, bond006

      B Offline
      B Offline
      bond006
      wrote on last edited by
      #2

      I solved the problem, but I got a new problem. ;) I'm able to send the return packet and I'm able to call WSARecv() on the socket, but I always receive the data, I sent. ;) What's this???

      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