![]() |
| | #1 |
| critical genius Join Date: Jul 2008 Location: SE Queens
Posts: 5,172
| meaning of listen queue Does this also mean that to truly limit the number of connections, a routine must exist to close them as soon as they are made beyond a certian number, or close the listening socket? |
| MK27 is offline | |
| | #2 |
| Registered User Join Date: Oct 2001
Posts: 2,110
| Imagine multiple clients trying to connect to a server at once. If the requests come in faster than the server can accept() them, then the listen queue fills. Up. When you accept() a connection from a socket that is listening, it removes the entry for that connection from the queue. |
| robwhit is offline | |
| | #3 | |
| critical genius Join Date: Jul 2008 Location: SE Queens
Posts: 5,172
| Quote:
I'm guessing this is one way a server gets "flooded" -- the CPU clocks out handling the queue. On second thought, even if the queue is full I imagine it won't take much to just "deny" (is that an action, or a socket status detectable by connect?) and accept one by one. Last edited by MK27; 10-08-2008 at 06:38 AM. | |
| MK27 is offline | |
| | #4 |
| Registered User Join Date: Oct 2001
Posts: 2,110
| > Just wanted to clarify for myself that this is the purpose of accept() accept accepts a socket from a listen queue from a listening socket. > and not to perform some possible filtering action (if (incoming==okay) accept), I don't know how you could direct accept to filter connections. > and that the queue is NOT the "maximum number of connections". I am almost completely sure that the listen queue is not the maximum number of connections, and you typically set it to some low number. > I'm guessing this is one way a server gets "flooded" -- the CPU clocks out handling the queue. On second thought, even if the queue is full I imagine it won't take much to just "deny" (is that an action, or a socket status detectable by connect?) and accept one by one. Yes, that's one way. Some stacks don't even refuse the connection, they just drop it. |
| robwhit is offline | |
![]() |
| Tags |
| sockets |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with FIFO QUEUE | jackfraust | C++ Programming | 23 | 04-03-2009 08:17 AM |
| Fixing my program | Mcwaffle | C Programming | 5 | 11-05-2008 03:55 AM |
| help with queues | Unregistered | C Programming | 3 | 05-21-2002 09:09 PM |
| help with queues | Unregistered | C Programming | 3 | 05-21-2002 11:39 AM |
| queue help | Unregistered | C Programming | 2 | 10-29-2001 09:38 AM |