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. Question about Winsock

Question about Winsock

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestionlearning
5 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.
  • N Offline
    N Offline
    nachilau
    wrote on last edited by
    #1

    Hello, I am learning socket programming in windows right now, however, I have some problems with the second parameter when I using this function: listen(socket, int). I don't understand what the second parameter for and how to use it. Thanks for someone to help! Nachi

    J 1 Reply Last reply
    0
    • N nachilau

      Hello, I am learning socket programming in windows right now, however, I have some problems with the second parameter when I using this function: listen(socket, int). I don't understand what the second parameter for and how to use it. Thanks for someone to help! Nachi

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

      MSDN : int listen ( SOCKET s, int backlog ); backlog [in] The maximum length of the queue of pending connections. If this value is SOMAXCONN, then the underlying service provider responsible for socket s will set the backlog to a maximum "reasonable" value. There is no standard provision to find out the actual backlog value. So its the number of pending connection on the server side, cos a listening socket is on server side! its up to u to know how manny u need in the queue waiting to be served by the server! Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

      N 1 Reply Last reply
      0
      • J jmkhael

        MSDN : int listen ( SOCKET s, int backlog ); backlog [in] The maximum length of the queue of pending connections. If this value is SOMAXCONN, then the underlying service provider responsible for socket s will set the backlog to a maximum "reasonable" value. There is no standard provision to find out the actual backlog value. So its the number of pending connection on the server side, cos a listening socket is on server side! its up to u to know how manny u need in the queue waiting to be served by the server! Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

        N Offline
        N Offline
        nachilau
        wrote on last edited by
        #3

        I am sorry, what do you mean pending connection? Would you mind to give me an example, let say Iset the blacklog to 3, what will happen? Thanks! Nachi

        J 1 Reply Last reply
        0
        • N nachilau

          I am sorry, what do you mean pending connection? Would you mind to give me an example, let say Iset the blacklog to 3, what will happen? Thanks! Nachi

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

          Pending means waiting inthe queue on server side, let say Iset the blacklog to 3, what will happen? A maximum of 3 will stay in the queue untill they are served! U can accept a conection with the accept function Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

          N 1 Reply Last reply
          0
          • J jmkhael

            Pending means waiting inthe queue on server side, let say Iset the blacklog to 3, what will happen? A maximum of 3 will stay in the queue untill they are served! U can accept a conection with the accept function Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;

            N Offline
            N Offline
            nachilau
            wrote on last edited by
            #5

            Thanks for the explaination! But what about the case "SOMAXCONN"? Thanks! Nachi

            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