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. flush the socket?

flush the socket?

Scheduled Pinned Locked Moved C / C++ / MFC
questionsysadminhelp
4 Posts 2 Posters 1 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
    lucy 0
    wrote on last edited by
    #1

    Hi, I have a TCP/IP socket, which is created and set up already. I also established the connection between the client and the server. Now my question is: is there any function to flush the socket? I want to do this because sometimes there is some timing issue between the server and the client, and the client will miss some data. If I do a shutdown(), closesocket(), then connect() on the client side, everything will be back to okay. Is there any easier way to replace the three function calls? Thanks for any hint!

    V 1 Reply Last reply
    0
    • L lucy 0

      Hi, I have a TCP/IP socket, which is created and set up already. I also established the connection between the client and the server. Now my question is: is there any function to flush the socket? I want to do this because sometimes there is some timing issue between the server and the client, and the client will miss some data. If I do a shutdown(), closesocket(), then connect() on the client side, everything will be back to okay. Is there any easier way to replace the three function calls? Thanks for any hint!

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      What I/O model does the program utilize? For example, one solution is memset() to clear the data buffer linked you pass to WSARecv(). Kuphryn

      L 1 Reply Last reply
      0
      • V valikac

        What I/O model does the program utilize? For example, one solution is memset() to clear the data buffer linked you pass to WSARecv(). Kuphryn

        L Offline
        L Offline
        lucy 0
        wrote on last edited by
        #3

        I am using TCP/IP socket, and send() recv(). Is WSARecv() more better than recv()?

        V 1 Reply Last reply
        0
        • L lucy 0

          I am using TCP/IP socket, and send() recv(). Is WSARecv() more better than recv()?

          V Offline
          V Offline
          valikac
          wrote on last edited by
          #4

          Correct. WSARecv() is IPv6 and is used under non-blocking I/O models. Kuphryn

          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