wait for server to close a session