Re: checking a socket status
- From: "Abubakar" <emailallrise@xxxxxxxxx>
- Date: Fri, 17 Mar 2006 16:51:31 +0500
Do you ever call recv? If the communication protocol is such that you
only send messages, but don't receive confirmation to them, then there's
a chance that a message that you think is received on the other end
yes I do exactly that. I send a message called "hello" and than the other
end responds in "hello_ack" (while I'm still in recv) after which I indicate
in the gui that the message was successfuly sent. But after gui notification
I have nothing more to do but wait for someone to click on the gui's one
button to send the message again and after which i call recv again to get
the acknowledgment. This cycle repeats. And the way I'm stopping the thread
is through waitforsingleobject as i explained in my previous reply.
Ab.
"Mihajlo Cvetanoviæ" <mac@xxxxxxxxxxxxxxxxxx> wrote in message
news:#2DwPaaSGHA.4960@xxxxxxxxxxxxxxxxxxxxxxx
Abubakar wrote:informed at
Now for client disconnection notifications purposes I need to be
updatesany time when the socket connection breaks so that I can do some gui
tobased on this. But as you have read above, since I'm in a blocking call
towaitforsingleobject, I cant call "send" or recv. Should I have another
thread calling "send" with zero buffer length after equal interval just
nicecheck if this socket connection is going fine or not? This doesnt seems
idea to me.
Do you ever call recv? If the communication protocol is such that you
only send messages, but don't receive confirmation to them, then there's
a chance that a message that you think is received on the other end
actually isn't received at all.
There are situations when even the TCP/IP stack (in the operating
system) "thinks" that the connection is alive, while it is really dead
(I call them zombie connections). If TCP/IP stack believes this, so
shall you. Your first an last line of defense of these situations is a
communication protocol that facilitates request-response mechanism. If a
response doesn't arrive in a timely fashion (you get to choose the
time-out period) then you declare a time out on a connection and declare
the connection dead for all practical purposes.
The use of such protocol can't be "workarounded" if you need to know
whether the message is *processed* on the other end (and *that* is what
you actually want to know, and not whether the message arrived, or even
whether the connection is broken).
.
- Follow-Ups:
- Re: checking a socket status
- From: Mihajlo Cvetanović
- Re: checking a socket status
- References:
- checking a socket status
- From: Abubakar
- Re: checking a socket status
- From: Mihajlo Cvetanović
- Re: checking a socket status
- From: Abubakar
- Re: checking a socket status
- From: Mihajlo Cvetanović
- checking a socket status
- Prev by Date: Re: std::string to char* (to Int ) ???
- Next by Date: Re: how to pass array from managed to COM
- Previous by thread: Re: checking a socket status
- Next by thread: Re: checking a socket status
- Index(es):
Relevant Pages
|