Implemented client timeouts and keep-alives