Winsock !!! Interesting and Major Issue
Hello all of u,
I developed Visual Basic client application which connects to JAVA Server using TCP socket. I m using wireless modem for internet connectivity. I m having 2 questions as follows.
1) If i remove modem directally , socket still shows status as connected and sends data to server the server ( Actually server machine is not avaliable) and no error is raised
2) If i plug off LAN cable , still the same is happening.
How can i identify these 2 things. There is one way i know but this is not a feasible solution, I can ping server computer after some time duration to check status of server. But In some cases Ping may be disable on the Server Computer.
What do u think
Milind
Re: Winsock !!! Interesting and Major Issue
So the Close or Error event don't fire ?
Re: Winsock !!! Interesting and Major Issue
If there is the chance that ping may not be available, use heartbeat messages or, in your case you may want to have the server acknowledge the message from the client.
If the client doesn't get a response to either type of message (heartbeat or data) then it can assume that the connection has been broken and take whatever steps are necessary to recover.
Re: Winsock !!! Interesting and Major Issue
Hello CCODER,
It solve my problem. I m sending Alive message to the server after some time duration say after each 10 sec and for the same server replies Yes. I found some important information about this. I got the explanation for this from following WEB.
http://tangentsoft.net/wskfaq/newbie.html
See following article :
2.12 - How do I detect when my TCP connection is closed?
Thanks CCODER
Regards
Milind