Improve Socket Comms handling - Add hard timeout

Add hard timeout to config (conf.json) and correct handling of closed
streams