we have implemented a remote control program.
we have noticed that if an user doesn't send any control command for a long time (for example about one to two hours), the socket gets closed for some reason.

I have googled about this problem, it seems that tcp protocol doesn't have this rule. is this something introduced by the os? is sending heartbeat packet the only solution? is there any tcp socket flag I can tweak to disable this disconnection behavior ?