From f17562945f6d3d15579e0c27604f2186f5a9d1aa Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 11 Aug 2001 02:02:24 +0000 Subject: [PATCH] Check to be sure that the client is still around before we send the invocation response. (Better to catch it and report it here than have the dobjmgr complain when it tries to dispatch an event on a non-existent object.) git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@224 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/server/InvocationProvider.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/presents/server/InvocationProvider.java b/src/java/com/threerings/presents/server/InvocationProvider.java index 91f239f7f..fad4243e3 100644 --- a/src/java/com/threerings/presents/server/InvocationProvider.java +++ b/src/java/com/threerings/presents/server/InvocationProvider.java @@ -1,11 +1,14 @@ // -// $Id: InvocationProvider.java,v 1.4 2001/08/11 00:05:58 mdb Exp $ +// $Id: InvocationProvider.java,v 1.5 2001/08/11 02:02:24 mdb Exp $ package com.threerings.cocktail.cher.server; -import com.threerings.cocktail.cher.dobj.MessageEvent; +import com.samskivert.util.StringUtil; + +import com.threerings.cocktail.cher.Log; import com.threerings.cocktail.cher.data.ClientObject; import com.threerings.cocktail.cher.data.InvocationObject; +import com.threerings.cocktail.cher.dobj.MessageEvent; /** * Invocation providers should extend this class when implementing @@ -114,10 +117,18 @@ public class InvocationProvider protected void deliverResponse (ClientObject source, Object[] args) { - // create the response event - MessageEvent mevt = new MessageEvent( - source.getOid(), InvocationObject.RESPONSE_NAME, args); - // and ship it off - CherServer.omgr.postEvent(mevt); + // make sure they didn't go away in the meanwhile + if (source.isActive()) { + // create the response event + MessageEvent mevt = new MessageEvent( + source.getOid(), InvocationObject.RESPONSE_NAME, args); + // and ship it off + CherServer.omgr.postEvent(mevt); + + } else { + Log.warning("Dropping invrsp due to disappearing client " + + "[cloid=" + source.getOid() + + ", args=" + StringUtil.toString(args) + "]."); + } } }