From 0cd73d2e5697fe37e21779651e42b22514080904 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 5 Nov 2002 05:47:36 +0000 Subject: [PATCH] Expose a calldown method that is called on the dobjmgr thread when a client loses their connection (either gracefully or not). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1898 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/server/PresentsClient.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/presents/server/PresentsClient.java b/src/java/com/threerings/presents/server/PresentsClient.java index 276387533..1c2ca0b3a 100644 --- a/src/java/com/threerings/presents/server/PresentsClient.java +++ b/src/java/com/threerings/presents/server/PresentsClient.java @@ -1,5 +1,5 @@ // -// $Id: PresentsClient.java,v 1.43 2002/10/31 21:03:57 mdb Exp $ +// $Id: PresentsClient.java,v 1.44 2002/11/05 05:47:36 mdb Exp $ package com.threerings.presents.server; @@ -388,7 +388,7 @@ public class PresentsClient * Clears out the tracked client subscriptions. Called when the client * goes away and shouldn't be called otherwise. */ - protected synchronized void clearSubscrips () + protected void clearSubscrips () { Iterator enum = _subscrips.elements(); while (enum.hasNext()) { @@ -526,11 +526,24 @@ public class PresentsClient // queued up before the connection went away) PresentsServer.omgr.postUnit(new Runnable() { public void run () { - clearSubscrips(); + sessionConnectionClosed(); } }); } + /** + * Called on the dobjmgr thread when the connection associated with + * this session has been closed and unmapped. If the user logged off + * before closing their connection, this will be preceded by a call to + * {@link #sessionDidEnd}. + */ + protected void sessionConnectionClosed () + { + // clear out our dobj subscriptions in case they weren't cleared + // by a call to sessionDidEnd + clearSubscrips(); + } + /** * Called by the connection manager when this client's connection * fails. This is invoked on the conmgr thread and should behave