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. SOCKETs: recv after accept

SOCKETs: recv after accept

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

    Hi, first of all, sorry for posting on the VC++ board, but there is no networking board here, and due to the fact that I am using VC++ ... here I go: I got a question on SOCKETs. I have a SOCKET listening on a specified port. When a client connects, I call accept. Due to specific reasons I do not call recv after this directly. There are about 1-2 seconds after the accept call until I loop on recv. Now my question: what happens with the data sent from the client to my SOCKET in the meanwhile? Is it lost? Is is buffered and I receive it when I then call recv? Thanks a lot! Chris

    N L 2 Replies Last reply
    0
    • C chrismc912

      Hi, first of all, sorry for posting on the VC++ board, but there is no networking board here, and due to the fact that I am using VC++ ... here I go: I got a question on SOCKETs. I have a SOCKET listening on a specified port. When a client connects, I call accept. Due to specific reasons I do not call recv after this directly. There are about 1-2 seconds after the accept call until I loop on recv. Now my question: what happens with the data sent from the client to my SOCKET in the meanwhile? Is it lost? Is is buffered and I receive it when I then call recv? Thanks a lot! Chris

      N Offline
      N Offline
      Nitzan Shaked
      wrote on last edited by
      #2

      If it's TCP, you needn't worry. It's buffered, and if the buffer space runs out the other side will know this. If it's UDP -- it will get buffered on your side until the buffer runs out. Then new packets will get lost. If it's another protocol -- well, that's up to your protocol stack. -- Nitzan

      C 1 Reply Last reply
      0
      • C chrismc912

        Hi, first of all, sorry for posting on the VC++ board, but there is no networking board here, and due to the fact that I am using VC++ ... here I go: I got a question on SOCKETs. I have a SOCKET listening on a specified port. When a client connects, I call accept. Due to specific reasons I do not call recv after this directly. There are about 1-2 seconds after the accept call until I loop on recv. Now my question: what happens with the data sent from the client to my SOCKET in the meanwhile? Is it lost? Is is buffered and I receive it when I then call recv? Thanks a lot! Chris

        L Offline
        L Offline
        Lymington
        wrote on last edited by
        #3

        It's buffered... up to a point, say, several 10s of K

        1 Reply Last reply
        0
        • N Nitzan Shaked

          If it's TCP, you needn't worry. It's buffered, and if the buffer space runs out the other side will know this. If it's UDP -- it will get buffered on your side until the buffer runs out. Then new packets will get lost. If it's another protocol -- well, that's up to your protocol stack. -- Nitzan

          C Offline
          C Offline
          chrismc912
          wrote on last edited by
          #4

          Thanks Nitzan! I am using TCP and this is also what I thought. Chris

          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