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. CSocket::OnReceive Question

CSocket::OnReceive Question

Scheduled Pinned Locked Moved C / C++ / MFC
questionworkspace
4 Posts 2 Posters 8 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.
  • J Offline
    J Offline
    jparsons
    wrote on last edited by
    #1

    I'm writing a program which uses a derived classe of CSocket to handle incoming data. I have overloaded OnReceive to catch the new data. My question is this. In my OnReceive function, I read the data and possibly do something with it. The doing something can take a little time. I'm wondering if OnReceive can be called while I'm still processing a previous OnReceive and thus interrupting my processing. If it can, what kind of protections can I setup to protect the data I access in the function? Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

    J 1 Reply Last reply
    0
    • J jparsons

      I'm writing a program which uses a derived classe of CSocket to handle incoming data. I have overloaded OnReceive to catch the new data. My question is this. In my OnReceive function, I read the data and possibly do something with it. The doing something can take a little time. I'm wondering if OnReceive can be called while I'm still processing a previous OnReceive and thus interrupting my processing. If it can, what kind of protections can I setup to protect the data I access in the function? Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      u are just one thread right?? Or multithreading? Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      J 1 Reply Last reply
      0
      • J jmkhael

        u are just one thread right?? Or multithreading? Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        J Offline
        J Offline
        jparsons
        wrote on last edited by
        #3

        Currently the application is single threaded. My question was, si there a possibility that MFC events or whatever they are called, can they overlap. Or will only one be called at any given time Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

        J 1 Reply Last reply
        0
        • J jparsons

          Currently the application is single threaded. My question was, si there a possibility that MFC events or whatever they are called, can they overlap. Or will only one be called at any given time Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

          J Offline
          J Offline
          jmkhael
          wrote on last edited by
          #4

          nope the cant, cos ur single threaded. Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          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