Clear the handler reference when we replace the connection. For some reason,
it seems like we're still getting messages from old connections. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6627 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -835,12 +835,17 @@ public class PresentsSession
|
||||
*/
|
||||
protected synchronized void setConnection (PresentsConnection conn)
|
||||
{
|
||||
// if our connection is being cleared out, record the amount of time we were connected to
|
||||
// our total connected time
|
||||
long now = System.currentTimeMillis();
|
||||
if (_conn != null && conn == null) {
|
||||
_connectTime += ((now - _networkStamp) / 1000);
|
||||
_messagesDropped = 0;
|
||||
if (_conn != null) {
|
||||
// if our connection is being cleared out, record the amount of time we were connected
|
||||
// to our total connected time
|
||||
if (conn == null) {
|
||||
_connectTime += ((now - _networkStamp) / 1000);
|
||||
_messagesDropped = 0;
|
||||
}
|
||||
|
||||
// make damn sure we don't get any more messages from the old connection
|
||||
_conn.setMessageHandler(null);
|
||||
}
|
||||
|
||||
// keep a handle to the new connection
|
||||
|
||||
Reference in New Issue
Block a user