I've managed to find what caused my sessions to disconnect.
In the view_agent_direct_connection.adm there is another registry setting.
clientSessionTimeout, this defaults to 10 hours / 36000 seconds.
Changing this to a greater value makes your connections stay alive.
POLICY !!ClientSessionTimeout
EXPLAIN !!ClientSessionTimeoutExplain
PART !!ClientSessionTimeout EDITTEXT
REQUIRED
DEFAULT "36000"
VALUENAME "clientSessionTimeout"
END PART
END POLICY