Tuesday 15 May 2012

java - Change the keep-alive timeout to detect a broken TCP connection -



java - Change the keep-alive timeout to detect a broken TCP connection -

i have been using udp long. turn tcp used me. want utilize tcp sockets in java , c application mac, linux , windows 7 oses.

while using udp, know broken connection, tracking simple lastly packet receive time. if suppose node not receive udp packet within 5 seconds node b, considering connection broken. when there no info send b or b a, both , b send little keep-alive packet (without data) each other every second. prevents connection beingness considered broken when not sending data.

so, want know how detection of broken connection works in tcp. want know if connection broken on reading or writing socket, , within 5 second.

i know reading / writing throw ioexception in java or homecoming -1/0 in c, how much time tcp take consider connection broken in each platform. , how can alter connection expire timeout value?

java c sockets tcp udp

No comments:

Post a Comment