Click here to Skip to main content
15,925,895 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Changing registry key Pin
Rage31-Jan-03 5:06
professionalRage31-Jan-03 5:06 
GeneralRe: Changing registry key Pin
Rage31-Jan-03 5:53
professionalRage31-Jan-03 5:53 
GeneralRe: Changing registry key Pin
xxhimanshu31-Jan-03 19:12
xxhimanshu31-Jan-03 19:12 
GeneralRe: Changing registry key Pin
Abbas_Riazi1-Feb-03 3:36
professionalAbbas_Riazi1-Feb-03 3:36 
GeneralClient/Server advice please! Pin
Rickard Andersson2031-Jan-03 1:52
Rickard Andersson2031-Jan-03 1:52 
GeneralRe: Client/Server advice please! Pin
valikac31-Jan-03 5:51
valikac31-Jan-03 5:51 
GeneralRe: Client/Server advice please! Pin
Rickard Andersson2031-Jan-03 6:47
Rickard Andersson2031-Jan-03 6:47 
GeneralRe: Client/Server advice please! Pin
Rohit  Sinha31-Jan-03 7:19
Rohit  Sinha31-Jan-03 7:19 
There are several articles on overlapped I/O and I/O completion ports on CP. Look in the internet and networks section. Non blocking sockets, while good, will not tell you whether a client is connected or not (unless you do something else to your code, but then you could do something similar to your existing code too).

Overlapped I/O is simple really. Instead of thinking in terms of threads, clients or sockets, you need to think in terms of events (read, write, send, recieve, etc). Once you get the hang of it, you will find it is more appropriate in many situations. On the other hand, just because non blocking sockets exist, does not mean you should use them in every situation. It takes much longer to implement them, and the gain is not always worth it. Only if your server is always busy, will you see an advantage.

In the mean time, while you are reading up on non blocking sockets, you could try this:

Keep a timer for all your sockets. Every receive resets the timer. If the timer is fired, a function will check to see if the client is disconnected. If it is, the client will be removed from the list. If not, the timer will be reset.

This will only be advisable if there aren't too many clients at the same time. Otherwise a lot of resources might be used up just for the timers. If there are too many clients connected, you may consider overlapped I/O.


  Regards,

  Rohit Sinha

GeneralRe: Client/Server advice please! Pin
Moak1-Feb-03 3:04
Moak1-Feb-03 3:04 
GeneralRe: Client/Server advice please! Pin
Rickard Andersson201-Feb-03 4:29
Rickard Andersson201-Feb-03 4:29 
GeneralRe: Client/Server advice please! Pin
Moak1-Feb-03 4:49
Moak1-Feb-03 4:49 
GeneralRe: Client/Server advice please! Pin
Rickard Andersson201-Feb-03 7:30
Rickard Andersson201-Feb-03 7:30 
GeneralRe: Client/Server advice please! Pin
Moak1-Feb-03 7:59
Moak1-Feb-03 7:59 
GeneralRe: Client/Server advice please! Pin
Rickard Andersson201-Feb-03 10:58
Rickard Andersson201-Feb-03 10:58 
GeneralRe: Client/Server advice please! Pin
Rickard Andersson201-Feb-03 7:53
Rickard Andersson201-Feb-03 7:53 
GeneralRe: Client/Server advice please! Pin
Moak1-Feb-03 8:03
Moak1-Feb-03 8:03 
GeneralRe: Client/Server advice please! Pin
Rickard Andersson201-Feb-03 10:53
Rickard Andersson201-Feb-03 10:53 
GeneralRe: Client/Server advice please! Pin
Moak1-Feb-03 11:07
Moak1-Feb-03 11:07 
GeneralRe: Client/Server advice please! Pin
valikac31-Jan-03 8:16
valikac31-Jan-03 8:16 
GeneralRe: Client/Server advice please! Pin
Abbas_Riazi1-Feb-03 3:39
professionalAbbas_Riazi1-Feb-03 3:39 
Generalwinsock, wininet Pin
Luke Murray31-Jan-03 1:07
Luke Murray31-Jan-03 1:07 
GeneralRe: winsock, wininet Pin
Rickard Andersson2031-Jan-03 1:31
Rickard Andersson2031-Jan-03 1:31 
GeneralRe: winsock, wininet Pin
Luke Murray31-Jan-03 1:41
Luke Murray31-Jan-03 1:41 
GeneralRSA algorithm Pin
Mahesh Varma31-Jan-03 1:04
Mahesh Varma31-Jan-03 1:04 
GeneralRe: RSA algorithm Pin
Abbas_Riazi31-Jan-03 1:38
professionalAbbas_Riazi31-Jan-03 1:38 

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.