wait client to shutdown the connection