Click here to Skip to main content
15,900,524 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Class definition - addendum [modified] Pin
Eugen Podsypalnikov16-Mar-10 4:36
Eugen Podsypalnikov16-Mar-10 4:36 
GeneralRe: Class definition - addendum Pin
Avi Berger16-Mar-10 7:15
Avi Berger16-Mar-10 7:15 
AnswerRe: Accessing a application defined DLL from sibling DLL gets no contructor available error C2512 (VC6.0). Pin
Avi Berger15-Mar-10 16:16
Avi Berger15-Mar-10 16:16 
GeneralRe: Accessing a application defined DLL from sibling DLL gets no contructor available error C2512 (VC6.0). Pin
Vaclav_15-Mar-10 17:12
Vaclav_15-Mar-10 17:12 
GeneralRe: Accessing a application defined DLL from sibling DLL gets no contructor available error C2512 (VC6.0). Pin
Avi Berger16-Mar-10 7:00
Avi Berger16-Mar-10 7:00 
QuestionFile Type Extensions Pin
maycockt15-Mar-10 6:46
maycockt15-Mar-10 6:46 
QuestionRe: File Type Extensions Pin
David Crow15-Mar-10 7:55
David Crow15-Mar-10 7:55 
AnswerRe: File Type Extensions Pin
maycockt16-Mar-10 3:45
maycockt16-Mar-10 3:45 
QuestionRe: File Type Extensions Pin
David Crow16-Mar-10 3:49
David Crow16-Mar-10 3:49 
AnswerRe: File Type Extensions Pin
ThatsAlok16-Mar-10 0:40
ThatsAlok16-Mar-10 0:40 
AnswerRe: File Type Extensions Pin
maycockt16-Mar-10 4:06
maycockt16-Mar-10 4:06 
AnswerRe: File Type Extensions Pin
Avi Berger16-Mar-10 5:13
Avi Berger16-Mar-10 5:13 
Questionhow to read data from wav file and use of fft Pin
arvindrawat11115-Mar-10 4:43
arvindrawat11115-Mar-10 4:43 
AnswerRe: how to read data from wav file and use of fft Pin
CPallini15-Mar-10 8:11
mveCPallini15-Mar-10 8:11 
QuestionHow to add blank spaces in line while file writing? Pin
Abhijit D. Babar15-Mar-10 3:25
Abhijit D. Babar15-Mar-10 3:25 
AnswerRe: How to add blank spaces in line while file writing? Pin
Richard MacCutchan15-Mar-10 3:50
mveRichard MacCutchan15-Mar-10 3:50 
AnswerRe: How to add blank spaces in line while file writing? Pin
Rajesh R Subramanian15-Mar-10 4:09
professionalRajesh R Subramanian15-Mar-10 4:09 
AnswerRe: How to add blank spaces in line while file writing? Pin
LouisLewis15-Mar-10 11:32
LouisLewis15-Mar-10 11:32 
QuestionSending KeyStroke Pin
S p k 52115-Mar-10 1:21
S p k 52115-Mar-10 1:21 
AnswerRe: Sending KeyStroke Pin
ThatsAlok15-Mar-10 1:53
ThatsAlok15-Mar-10 1:53 
AnswerRe: Sending KeyStroke Pin
Rajesh R Subramanian15-Mar-10 2:05
professionalRajesh R Subramanian15-Mar-10 2:05 
QuestionRe: Sending KeyStroke Pin
David Crow15-Mar-10 6:05
David Crow15-Mar-10 6:05 
QuestionCAsyncSocket - socket error Pin
diptipanchal15-Mar-10 0:33
diptipanchal15-Mar-10 0:33 
AnswerRe: CAsyncSocket - socket error Pin
Rozis15-Mar-10 2:58
Rozis15-Mar-10 2:58 
AnswerRe: CAsyncSocket - socket error Pin
Moak15-Mar-10 4:05
Moak15-Mar-10 4:05 
diptipanchal wrote:

The last_error remains 0 even if Ethernet cable is removed. Shall I use a timer feature & keep checking if the connection is available or not. If yes, could you help me in achieving this?


A TCP socket will not return an error immediately if a network connection is going down. This is by design, if there is a short network outage the connection can recover... on the other side it takes a couple of minutes until an interrupted connection is reported back to the socket (and will be closed with an error).

You can do two things to detect an interrupted connection, such as a removed Ethernet cable:

1) Implement a reasonable fast heartbeat. If peer A wants to know about the status/availability of peer B, it either has to receive a "message" from B in regular intervals (and therfor knows that peer B is alive) -or- when there is no regular traffic to piggyback the heartbeat then one of the peers has to initiate (additional) heartbeats in reasonable intervals. For example an IRC server uses regular ping/pong messages every few minutes to find out about the connection status of its chat clients.

2) Use the IP Helper API[^] to check if your local network interfaces are down.

Hope it helps!

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.