Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Frustrated with conversion Pin
Raj Prathap15-Nov-06 18:51
Raj Prathap15-Nov-06 18:51 
GeneralRe: Frustrated with conversion Pin
Christian Graus15-Nov-06 19:13
protectorChristian Graus15-Nov-06 19:13 
GeneralRe: Frustrated with conversion Pin
Stick^15-Nov-06 19:44
Stick^15-Nov-06 19:44 
QuestionCreating a DLL Pin
colin_os15-Nov-06 10:38
colin_os15-Nov-06 10:38 
AnswerRe: Creating a DLL Pin
Blake Miller15-Nov-06 10:52
Blake Miller15-Nov-06 10:52 
QuestionCSocket connections Pin
jpyp15-Nov-06 8:53
jpyp15-Nov-06 8:53 
AnswerRe: CSocket connections Pin
Mark Salsbery15-Nov-06 10:19
Mark Salsbery15-Nov-06 10:19 
GeneralRe: CSocket connections Pin
jpyp16-Nov-06 6:05
jpyp16-Nov-06 6:05 
You are correct. Because of my total_scks counter, accept() only gets called twice. However since I got your reply I found a little more info from the Tornado help docs. I now understand a lot better what is going on and I suspect a lot of people do not know this:

The queue size parameter in listen() does not affect the number of simultaneous connections that the server will accept. You need a counter like I have implemented to restrict the number of simultaneous connections. In my case if I already have 2 connections and I have 5 for queue size as parameter to the listen() function, then the server will queue up to 5 new clients. Once one of the current connections closes, the first queued client will then be accepted.
What I now understand is that listen() actually makes the connection with the client, not accept(). Therefore if you have a counter of 2 and a queue of 5, you could actually have 7 clients connected at once but only 2 of these will be accepted and transfering data. The connect() function on the clients that are queued returns successful because listen() on the server made the connection.

This last point is very interesting and brings me to my next question:
How can I detect on the client that the connection is not yet accepted by the server or that I lost the connection with the server?

Thanks for your help?


jpyp

GeneralRe: CSocket connections Pin
Mark Salsbery16-Nov-06 7:08
Mark Salsbery16-Nov-06 7:08 
GeneralRe: CSocket connections Pin
jpyp16-Nov-06 7:30
jpyp16-Nov-06 7:30 
QuestionDetect button three press Pin
Johpoke15-Nov-06 8:33
Johpoke15-Nov-06 8:33 
QuestionRe: Detect button three press Pin
David Crow15-Nov-06 10:01
David Crow15-Nov-06 10:01 
AnswerRe: Detect button three press Pin
Johpoke16-Nov-06 5:32
Johpoke16-Nov-06 5:32 
QuestionRe: Detect button three press Pin
David Crow16-Nov-06 5:39
David Crow16-Nov-06 5:39 
GeneralRe: Detect button three press Pin
Mark Salsbery16-Nov-06 5:55
Mark Salsbery16-Nov-06 5:55 
GeneralRe: Detect button three press Pin
Johpoke16-Nov-06 7:09
Johpoke16-Nov-06 7:09 
GeneralRe: Detect button three press Pin
Mark Salsbery16-Nov-06 7:18
Mark Salsbery16-Nov-06 7:18 
GeneralRe: Detect button three press Pin
Johpoke16-Nov-06 7:23
Johpoke16-Nov-06 7:23 
GeneralRe: Detect button three press Pin
Mark Salsbery16-Nov-06 7:33
Mark Salsbery16-Nov-06 7:33 
GeneralRe: Detect button three press Pin
Johpoke16-Nov-06 8:39
Johpoke16-Nov-06 8:39 
AnswerRe: Detect button three press Pin
PJ Arends15-Nov-06 16:20
professionalPJ Arends15-Nov-06 16:20 
AnswerRe: Detect button three press Pin
Hamid_RT15-Nov-06 18:39
Hamid_RT15-Nov-06 18:39 
QuestionClosing popup dialog window. Pin
xkrja15-Nov-06 7:23
xkrja15-Nov-06 7:23 
AnswerRe: Closing popup dialog window. Pin
Mark Salsbery15-Nov-06 11:23
Mark Salsbery15-Nov-06 11:23 
GeneralRe: Closing popup dialog window. Pin
xkrja15-Nov-06 21:31
xkrja15-Nov-06 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.