Click here to Skip to main content
15,867,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Display CBitmap into CStatic Pin
Roger Allen6-Jun-11 2:24
Roger Allen6-Jun-11 2:24 
GeneralRe: Display CBitmap into CStatic Pin
_Flaviu6-Jun-11 2:39
_Flaviu6-Jun-11 2:39 
QuestionCStatic ModifyStyle Pin
_Flaviu6-Jun-11 1:00
_Flaviu6-Jun-11 1:00 
AnswerRe: CStatic ModifyStyle Pin
The_Inventor6-Jun-11 20:41
The_Inventor6-Jun-11 20:41 
AnswerRe: CStatic ModifyStyle Pin
Code-o-mat7-Jun-11 22:59
Code-o-mat7-Jun-11 22:59 
QuestionHow to use tcp keepalive to check the client is alive? Pin
wangningyu4-Jun-11 23:23
wangningyu4-Jun-11 23:23 
AnswerRe: How to use tcp keepalive to check the client is alive? Pin
Code-o-mat5-Jun-11 22:55
Code-o-mat5-Jun-11 22:55 
GeneralRe: How to use tcp keepalive to check the client is alive? Pin
Emilio Garavaglia6-Jun-11 3:41
Emilio Garavaglia6-Jun-11 3:41 
Code-o-mat wrote:
2 hours is a lot of time, you might want to shorten that.


Dangerous: those timers are expected to be consistent on a very wide number of system, and -because of the way TCP works- there is no need to make it shorter.

The keep-alive is sent on a silent socket to let it be not-anymore silent. But the problem is ... why is it silent?

If there are data to let flow, TCP itself recover transmission error and - if that cannot be done - reports to the soket WSAENETRESET/WSAENOTCONN independently on every keep-alive feature.
If there are no data to let flow for long time, considering servers queue, routing tables, switches cam table, firewall caches, ARP table etc. assuming everything still works the same is risky. Better to close the socket, and reopen it again when furtherly needed, and use some "session layer command or data" (the application should define what the y should be) to track the state of the session or re-sync the client and the server.

In other words, the OP had better to implement a more robust application protocol that uses the underlying socket not just to transfer data, but also to exchange some status information about the existence and activity of the client and the server (this can be done more frequently) if he wants to promptly react to an unexpected event.

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


GeneralRe: How to use tcp keepalive to check the client is alive? Pin
Code-o-mat6-Jun-11 3:58
Code-o-mat6-Jun-11 3:58 
AnswerRe: How to use tcp keepalive to check the client is alive? Pin
jschell6-Jun-11 9:07
jschell6-Jun-11 9:07 
Questionmysql error and UNICODE Pin
includeh104-Jun-11 18:44
includeh104-Jun-11 18:44 
AnswerRe: mysql error and UNICODE Pin
Code-o-mat5-Jun-11 22:26
Code-o-mat5-Jun-11 22:26 
QuestionIs it possible to set another visual style only for my application [modified] Pin
Cold_Fearing_Bird4-Jun-11 16:59
Cold_Fearing_Bird4-Jun-11 16:59 
AnswerRe: Is it possible to set another visual style only for my application Pin
Rotted Frog6-Jun-11 20:46
Rotted Frog6-Jun-11 20:46 
Question[Win32] How draw a rectangle on the desktop Pin
Member 29654714-Jun-11 9:34
Member 29654714-Jun-11 9:34 
QuestionRe: [Win32] How draw a rectangle on the desktop Pin
Mark Salsbery4-Jun-11 11:16
Mark Salsbery4-Jun-11 11:16 
AnswerRe: [Win32] How draw a rectangle on the desktop Pin
Member 29654714-Jun-11 11:51
Member 29654714-Jun-11 11:51 
GeneralRe: [Win32] How draw a rectangle on the desktop Pin
Mark Salsbery4-Jun-11 11:56
Mark Salsbery4-Jun-11 11:56 
AnswerRe: [Win32] How draw a rectangle on the desktop Pin
bob169725-Jun-11 4:40
bob169725-Jun-11 4:40 
QuestionEncryption/Decryption on html file? Pin
Le@rner3-Jun-11 20:04
Le@rner3-Jun-11 20:04 
AnswerRe: Encryption/Decryption on html file? Pin
Mark Salsbery3-Jun-11 20:27
Mark Salsbery3-Jun-11 20:27 
GeneralRe: Encryption/Decryption on html file? Pin
Le@rner3-Jun-11 21:39
Le@rner3-Jun-11 21:39 
AnswerRe: Encryption/Decryption on html file? Pin
Philippe Mori4-Jun-11 16:47
Philippe Mori4-Jun-11 16:47 
AnswerRe: Encryption/Decryption on html file? Pin
Philippe Mori4-Jun-11 16:53
Philippe Mori4-Jun-11 16:53 
QuestionHelp with Side-by-Side error Pin
turbosupramk33-Jun-11 9:44
turbosupramk33-Jun-11 9:44 

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.