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#
  4. How to limit the number of simultaneously connected clients

How to limit the number of simultaneously connected clients

Scheduled Pinned Locked Moved C#
tutorialquestion
6 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.
  • F Offline
    F Offline
    Frozzeg
    wrote on last edited by
    #1

    Adn can it be done before calling Socket.Accept() ?

    L N 2 Replies Last reply
    0
    • F Frozzeg

      Adn can it be done before calling Socket.Accept() ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Just stop calling accept until the number of connections is below your threshold value again?

      F 1 Reply Last reply
      0
      • L Lost User

        Just stop calling accept until the number of connections is below your threshold value again?

        F Offline
        F Offline
        Frozzeg
        wrote on last edited by
        #3

        or rather I need to limit the maximum number of connections that can make 1 client p.s. sry for my english

        1 Reply Last reply
        0
        • F Frozzeg

          Adn can it be done before calling Socket.Accept() ?

          N Offline
          N Offline
          Nagy Vilmos
          wrote on last edited by
          #4

          Based on needing to control the conections per client, you are going to need to establish who the connection is from. What is the clint that is connecting? Can you not manage your interface so that after accepting the connection they must send a message to establish the full session. That way they can [provide additional information so the server knows who is connecting.


          Panic, Chaos, Destruction. My work here is done.

          L 1 Reply Last reply
          0
          • N Nagy Vilmos

            Based on needing to control the conections per client, you are going to need to establish who the connection is from. What is the clint that is connecting? Can you not manage your interface so that after accepting the connection they must send a message to establish the full session. That way they can [provide additional information so the server knows who is connecting.


            Panic, Chaos, Destruction. My work here is done.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Why not just check the source IP? They could still try to spam halfopen connections, but they can't hope to get a connected TCP socket if they fake their source IP, so they won't spoof it if their goal is getting more connections.

            F 1 Reply Last reply
            0
            • L Lost User

              Why not just check the source IP? They could still try to spam halfopen connections, but they can't hope to get a connected TCP socket if they fake their source IP, so they won't spoof it if their goal is getting more connections.

              F Offline
              F Offline
              Frozzeg
              wrote on last edited by
              #6

              in Apache done that I need, Apache accepting first 300 connections and then he stop accepting new connection before i destroy old connections i.e. it does not accept a new connection, and immediately disconnect, just an exception when i trying to do 301-th connection

              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