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)
|
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();
|
long now = System.currentTimeMillis();
|
||||||
if (_conn != null && conn == null) {
|
if (_conn != null) {
|
||||||
_connectTime += ((now - _networkStamp) / 1000);
|
// if our connection is being cleared out, record the amount of time we were connected
|
||||||
_messagesDropped = 0;
|
// 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
|
// keep a handle to the new connection
|
||||||
|
|||||||
Reference in New Issue
Block a user