hi, i found that if the client uses IOCP, it cannot detect the network
failure. so it always thinks that the network is good.
for examples, you run both client and server in different computers which
connected each other via a switcher. if you disconnect the server computer
from the network by unpluging the network cable, the client won't know
this( the function
GetQueuedCompletionStatus will block for ever), so it doesn't know when it
should close the socket for the network failure. but if you disconnect the
client computer from the network, the client will known this.(the function
GetQueuedCompletionStatus will return 0, and lpOverlapped!=NULL, which means
IO failed). i don't know how to deal with it, even if i set the tcp option
SO_KEEPALIVE, it doesn't work.
Does anybody have any good solution for me? i don't want to send heartbeat
message to keep it alive. if anybody can help me, please send an email to
me.
peng-jr@21cn.com thanks in advance.
Replies