Restart socket when exception in  keepalive