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. MFC - CAsyncSocket class

MFC - CAsyncSocket class

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
6 Posts 4 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.
  • L Offline
    L Offline
    liz3
    wrote on last edited by
    #1

    I have a very basic question to ask. I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?

    N 1 Reply Last reply
    0
    • L liz3

      I have a very basic question to ask. I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      liz3 wrote:

      I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?

      If you have established a connection with the client, the OnReceive() function will be called automtically called when the client sends you a message.

      nave [My Articles] [My Blog]

      C 1 Reply Last reply
      0
      • N Naveen

        liz3 wrote:

        I'm not able to find out if the OnReceive() function of the CAsyncSocket class will always be called automatically when a message is sent by the client OR do we have to write code such that the function is called everytime a message is sent?

        If you have established a connection with the client, the OnReceive() function will be called automtically called when the client sends you a message.

        nave [My Articles] [My Blog]

        C Offline
        C Offline
        Cool_Dev
        wrote on last edited by
        #3

        yes.. u r rite!!!:thumbsup:

        L 1 Reply Last reply
        0
        • C Cool_Dev

          yes.. u r rite!!!:thumbsup:

          L Offline
          L Offline
          liz3
          wrote on last edited by
          #4

          thankyou. But it is not called just the first time right? I mean, client and server establish the connection, client sends a msg to the server. Then, the OnReceive() function is called. But after that, for subsequent msgs sent by the client, will the OnReceive() function be called automatically?

          M 1 Reply Last reply
          0
          • L liz3

            thankyou. But it is not called just the first time right? I mean, client and server establish the connection, client sends a msg to the server. Then, the OnReceive() function is called. But after that, for subsequent msgs sent by the client, will the OnReceive() function be called automatically?

            M Offline
            M Offline
            Moak
            wrote on last edited by
            #5

            Yes see OnReceive() on MSDN[^]: Notifies this socket that there is data in the buffer for it to retrieve by calling Receive.

            Webchat in Europe :java: (only 4K)

            L 1 Reply Last reply
            0
            • M Moak

              Yes see OnReceive() on MSDN[^]: Notifies this socket that there is data in the buffer for it to retrieve by calling Receive.

              Webchat in Europe :java: (only 4K)

              L Offline
              L Offline
              liz3
              wrote on last edited by
              #6

              ok, thankyou all for ur help

              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