sockets - Listen to disconnections of tcp clients in Google Chrome app -


in documentation chrome.sockets.tcpserver , chrome.sockets.tcp there mentioned how listen disconnection of clients. how can it?

i found out resultcode == -15 in callback of chrome.sockets.tcp.send-function if client disconnected. want notified if disconnects instead of use pro-active method of checking that.

it's understanding socket disconnection isn't underlying os can detect. there's no socket-level way tell difference between client gone , client might taking while send next packet. it's possible deeper tcp/ip knowledge correct me, answer i've seen.

you can have clients send application-level disconnect message, or else periodic heartbeat without server conclude client gone. more detail here: is tcp keepalive mechanism determine broken link?


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -