We're getting datagram PONGs on resumed connections that haven't yet sent

datagram PINGs.  Let's make sure that the connection to which we're sending
the pong is the same one from which we received the ping.  Ping, pong, ping,
pong.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6618 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2011-04-08 02:38:49 +00:00
parent afe0589baf
commit 0765897bcc
@@ -874,11 +874,21 @@ public class PresentsSession
* Callable from non-dobjmgr thread, this queues up a runnable on the dobjmgr thread to post * Callable from non-dobjmgr thread, this queues up a runnable on the dobjmgr thread to post
* the supplied message to this client. * the supplied message to this client.
*/ */
protected final void safePostMessage (final DownstreamMessage msg) protected final void safePostMessage (DownstreamMessage msg)
{
safePostMessage(msg, null);
}
/**
* Callable from non-dobjmgr thread, this queues up a runnable on the dobjmgr thread to post
* the supplied message to this client.
*/
protected final void safePostMessage (
final DownstreamMessage msg, final PresentsConnection expect)
{ {
_omgr.postRunnable(new Runnable() { _omgr.postRunnable(new Runnable() {
public void run () { public void run () {
postMessage(msg, null); postMessage(msg, expect);
} }
}); });
} }
@@ -1165,7 +1175,8 @@ public class PresentsSession
if (PING_DEBUG) { if (PING_DEBUG) {
log.info("Got ping, ponging", "client", client.getAuthName()); log.info("Got ping, ponging", "client", client.getAuthName());
} }
client.safePostMessage(new PongResponse(req.getUnpackStamp(), req.getTransport())); client.safePostMessage(new PongResponse(req.getUnpackStamp(), req.getTransport()),
client.getConnection());
} }
} }