From 6bf19ba41947eded3e65884f30b70c4470197d06 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 7 Aug 2008 20:58:16 +0000 Subject: [PATCH] We need to tell the clients that we did logoff after we've actually shutdown and clear out our socket. The DID_LOGOFF notification is sent out to the client after we've sent our LOGOFF request to the server, so we need to be sure that no other messages go to the server after the LOGOFF request otherwise we risk the server generating spurious warnings (like it does currently in the thousands daily). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5297 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/presents/client/Communicator.as | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/as/com/threerings/presents/client/Communicator.as b/src/as/com/threerings/presents/client/Communicator.as index b17f0220c..eb1bab456 100644 --- a/src/as/com/threerings/presents/client/Communicator.as +++ b/src/as/com/threerings/presents/client/Communicator.as @@ -144,14 +144,11 @@ public class Communicator protected function shutdown (logonError :Error) :void { - _client.notifyObservers(ClientEvent.CLIENT_DID_LOGOFF, null); - if (_socket != null) { try { _socket.close(); } catch (err :Error) { - Log.getLog(this).warning( - "Error closing failed socket [error=" + err + "]."); + Log.getLog(this).warning("Error closing failed socket [error=" + err + "]."); } removeListeners(); _socket = null; @@ -161,14 +158,14 @@ public class Communicator _outBuffer = null; } + _client.notifyObservers(ClientEvent.CLIENT_DID_LOGOFF, null); _client.cleanup(logonError); } protected function sendMessage (msg :UpstreamMessage) :void { if (_outStream == null) { - Log.getLog(this).warning( - "No socket, dropping msg [msg=" + msg + "]."); + Log.getLog(this).warning("No socket, dropping msg [msg=" + msg + "]."); return; }