Add setTimeout function to the json socket and close sockets after 5sec of inactivity