Made session ending more robust in the face of potential boocehs by
derived classes. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3118 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ClientManager.java,v 1.38 2004/08/27 02:20:23 mdb Exp $
|
||||
// $Id: ClientManager.java,v 1.39 2004/09/15 18:21:26 mdb Exp $
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||
@@ -427,14 +427,15 @@ public class ClientManager
|
||||
|
||||
if (victims != null) {
|
||||
for (int ii = 0; ii < victims.size(); ii++) {
|
||||
PresentsClient client = (PresentsClient)victims.get(ii);
|
||||
try {
|
||||
PresentsClient client = (PresentsClient)victims.get(ii);
|
||||
Log.info("Client expired, ending session " +
|
||||
"[client=" + client +
|
||||
", dtime=" + (now-client.getNetworkStamp()) + "ms].");
|
||||
client.endSession();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Choke while flushing clients.");
|
||||
Log.warning("Choke while flushing client " +
|
||||
"[victim=" + client + "].");
|
||||
Log.logStackTrace(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PresentsClient.java,v 1.67 2004/08/27 02:20:23 mdb Exp $
|
||||
// $Id: PresentsClient.java,v 1.68 2004/09/15 18:21:26 mdb Exp $
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||
@@ -402,7 +402,12 @@ public class PresentsClient
|
||||
// first place, in which case we have to cope as best we can
|
||||
if (_clobj != null) {
|
||||
// and clean up after ourselves
|
||||
sessionDidEnd();
|
||||
try {
|
||||
sessionDidEnd();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Choked in sessionDidEnd [client=" + this + "].");
|
||||
Log.logStackTrace(e);
|
||||
}
|
||||
|
||||
// release (and destroy) our client object
|
||||
_cmgr.releaseClientObject(_username);
|
||||
|
||||
Reference in New Issue
Block a user