As on the server, provide a means to detect whether we can

transmit datagrams.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5801 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2009-05-26 20:10:46 +00:00
parent 510e6982bf
commit eb77929940
3 changed files with 22 additions and 0 deletions
@@ -186,6 +186,12 @@ public class BlockingCommunicator extends Communicator
return _lastWrite;
}
@Override // from Communicator
public boolean getTransmitDatagrams ()
{
return _datagramWriter != null;
}
@Override // from Communicator
protected synchronized void logonSucceeded (AuthResponseData data)
{
@@ -397,6 +397,14 @@ public class Client
return (_comm != null);
}
/**
* Checks whether we should transmit datagrams.
*/
public synchronized boolean getTransmitDatagrams ()
{
return (_comm != null && _comm.getTransmitDatagrams());
}
/**
* Returns true if we are logged on, false if we're not.
*/
@@ -76,6 +76,14 @@ public abstract class Communicator
return _lastWrite;
}
/**
* Checks whether we should transmit datagrams.
*/
public boolean getTransmitDatagrams ()
{
return false;
}
/**
* Makes a note of the time at which we last communicated with the server.
*/