Added an extra step to the datagram negotation process. Before

the server starts sending datagrams willy-nilly, it must wait for 
a (reliable) go-ahead from the client.  Otherwise, it's possible 
that the server may be successfully receiving datagrams but not 
sending them.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5792 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2009-05-21 04:16:41 +00:00
parent 0f70a5c8d2
commit 6dd16483be
5 changed files with 75 additions and 3 deletions
@@ -56,6 +56,7 @@ import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.net.DownstreamMessage;
import com.threerings.presents.net.LogoffRequest;
import com.threerings.presents.net.PingRequest;
import com.threerings.presents.net.TransmitDatagramsRequest;
import com.threerings.presents.net.Transport;
import com.threerings.presents.net.UpstreamMessage;
import com.threerings.presents.util.DatagramSequencer;
@@ -766,6 +767,9 @@ public class BlockingCommunicator extends Communicator
if (cport > 0) {
log.info("Datagram connection established", "port", cport);
// notify the server
postMessage(new TransmitDatagramsRequest());
// start up the writer thread
_datagramWriter = new DatagramWriter();
_datagramWriter.start();