implemented configurable keep-alive handling