How to track that Cleint or Server is disconneted
-
HI, I have a network application one is client and other is server running on internet , How can I come to know the one of them is get disconnect (or due to disconnection of internet one application is not listeinign or replying) How can I implement this? Regards.
-
HI, I have a network application one is client and other is server running on internet , How can I come to know the one of them is get disconnect (or due to disconnection of internet one application is not listeinign or replying) How can I implement this? Regards.
If you TCP you'll naturally get an exception right? i.e Stream is disconnected. You dont have to invent mechanism.But with UDP, You have to sense it on your own, may be with something like "Heart beat" sensing.
--[V]--
-
If you TCP you'll naturally get an exception right? i.e Stream is disconnected. You dont have to invent mechanism.But with UDP, You have to sense it on your own, may be with something like "Heart beat" sensing.
--[V]--
-
Tell me how do you get data from the server? If possible, post the code. (may be inside the thread, if you've created one)make a
try{} catch{}
on the code block where you receive data from client. if, the server gets disconnected, it'll enter into the catch block.
--[V]--
-
If you TCP you'll naturally get an exception right? i.e Stream is disconnected. You dont have to invent mechanism.But with UDP, You have to sense it on your own, may be with something like "Heart beat" sensing.
--[V]--
VuNic wrote:
You have to sense it on your own, may be with something like "Heart beat" sensing.
Humm Heart Beat... my heart beat for...... :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
VuNic wrote:
You have to sense it on your own, may be with something like "Heart beat" sensing.
Humm Heart Beat... my heart beat for...... :)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
VuNic wrote:
To sense it, you need a *lady* client!!
I don't have ONe:((
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You