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
This commit is contained in:
Michael Bayne
2008-08-07 20:58:16 +00:00
parent 3385e9ba4a
commit 6bf19ba419
@@ -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;
}