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. Problem with CSocket Listen function

Problem with CSocket Listen function

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

    I am calling the Listen function as follows: Listen(1); but I can still Accept more than one connections. I know for sure that the first connection is still alive when I accept the second one or any other ones after. Without having to post all my code, do you have any idea of what I may be doing wrong? Thanks! jpyp

    B 1 Reply Last reply
    0
    • J jpyp

      I am calling the Listen function as follows: Listen(1); but I can still Accept more than one connections. I know for sure that the first connection is still alive when I accept the second one or any other ones after. Without having to post all my code, do you have any idea of what I may be doing wrong? Thanks! jpyp

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

      The 1 param is the number of un-accepted connections that can be queued. So, you may have many connections open, regardless of your listen queue size. The listen queue stores the pending connections until you "accept" them. So, in a busy environment, you need to have a fair sized queue so that you do not refuse clients because you cannot accept connections fast enough.  onwards and upwards...

      J 1 Reply Last reply
      0
      • B basementman

        The 1 param is the number of un-accepted connections that can be queued. So, you may have many connections open, regardless of your listen queue size. The listen queue stores the pending connections until you "accept" them. So, in a busy environment, you need to have a fair sized queue so that you do not refuse clients because you cannot accept connections fast enough.  onwards and upwards...

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

        Thanks! That explains a lot! Thanks! jpyp

        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