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
|
// Narya library - tools for developing networked games
|
||||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||||
@@ -427,14 +427,15 @@ public class ClientManager
|
|||||||
|
|
||||||
if (victims != null) {
|
if (victims != null) {
|
||||||
for (int ii = 0; ii < victims.size(); ii++) {
|
for (int ii = 0; ii < victims.size(); ii++) {
|
||||||
try {
|
|
||||||
PresentsClient client = (PresentsClient)victims.get(ii);
|
PresentsClient client = (PresentsClient)victims.get(ii);
|
||||||
|
try {
|
||||||
Log.info("Client expired, ending session " +
|
Log.info("Client expired, ending session " +
|
||||||
"[client=" + client +
|
"[client=" + client +
|
||||||
", dtime=" + (now-client.getNetworkStamp()) + "ms].");
|
", dtime=" + (now-client.getNetworkStamp()) + "ms].");
|
||||||
client.endSession();
|
client.endSession();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Choke while flushing clients.");
|
Log.warning("Choke while flushing client " +
|
||||||
|
"[victim=" + client + "].");
|
||||||
Log.logStackTrace(e);
|
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
|
// Narya library - tools for developing networked games
|
||||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
// 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
|
// first place, in which case we have to cope as best we can
|
||||||
if (_clobj != null) {
|
if (_clobj != null) {
|
||||||
// and clean up after ourselves
|
// and clean up after ourselves
|
||||||
|
try {
|
||||||
sessionDidEnd();
|
sessionDidEnd();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.warning("Choked in sessionDidEnd [client=" + this + "].");
|
||||||
|
Log.logStackTrace(e);
|
||||||
|
}
|
||||||
|
|
||||||
// release (and destroy) our client object
|
// release (and destroy) our client object
|
||||||
_cmgr.releaseClientObject(_username);
|
_cmgr.releaseClientObject(_username);
|
||||||
|
|||||||
Reference in New Issue
Block a user