diff --git a/src/java/com/threerings/presents/client/Communicator.java b/src/java/com/threerings/presents/client/Communicator.java index 97f5d5f9d..4e2ab7d05 100644 --- a/src/java/com/threerings/presents/client/Communicator.java +++ b/src/java/com/threerings/presents/client/Communicator.java @@ -1,5 +1,5 @@ // -// $Id: Communicator.java,v 1.28 2003/04/10 22:02:59 mdb Exp $ +// $Id: Communicator.java,v 1.29 2003/06/05 00:26:16 ray Exp $ package com.threerings.presents.client; @@ -120,10 +120,7 @@ public class Communicator return; } - // stop our ping interval - if (_piid != -1) { - IntervalManager.remove(_piid); - } + stopPingInterval(); // post a logoff message postMessage(new LogoffRequest()); @@ -235,6 +232,9 @@ public class Communicator // clear out our reader reference _reader = null; + // in case we haven't already done it. + stopPingInterval(); + if (_writer == null) { // there's no writer during authentication, so we may be // responsible for closing the socket channel @@ -346,6 +346,17 @@ public class Communicator return (now - _lastWrite > PingRequest.PING_INTERVAL); } + /** + * Stops our ping interval. + */ + protected void stopPingInterval () + { + if (_piid != -1) { + IntervalManager.remove(_piid); + _piid = -1; + } + } + /** * Reads a new message from the socket (blocking until a message has * arrived).