Whitespace
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6517 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -186,7 +186,6 @@ public abstract class ConnectionManager extends LoopingThread
|
|||||||
// totally done so that we can send shutdown-related events out to our clients; during
|
// totally done so that we can send shutdown-related events out to our clients; during
|
||||||
// those last moments we don't want to accept new connections or read any incoming messages
|
// those last moments we don't want to accept new connections or read any incoming messages
|
||||||
if (super.isRunning()) {
|
if (super.isRunning()) {
|
||||||
|
|
||||||
handleIncoming(iterStamp);
|
handleIncoming(iterStamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,8 +194,8 @@ public abstract class ConnectionManager extends LoopingThread
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void handleIncoming(long iterStamp) {
|
protected void handleIncoming (long iterStamp)
|
||||||
|
{
|
||||||
SocketChannel accepted;
|
SocketChannel accepted;
|
||||||
while ((accepted = _acceptedq.getNonBlocking()) != null) {
|
while ((accepted = _acceptedq.getNonBlocking()) != null) {
|
||||||
handleAcceptedSocket(accepted);
|
handleAcceptedSocket(accepted);
|
||||||
|
|||||||
@@ -605,14 +605,12 @@ public class BlockingCommunicator extends Communicator
|
|||||||
*/
|
*/
|
||||||
protected class Reader extends LoopingThread
|
protected class Reader extends LoopingThread
|
||||||
{
|
{
|
||||||
public Reader ()
|
public Reader () {
|
||||||
{
|
|
||||||
super("BlockingCommunicator_Reader");
|
super("BlockingCommunicator_Reader");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void willStart ()
|
protected void willStart () {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
// connect to the server
|
// connect to the server
|
||||||
connect();
|
connect();
|
||||||
@@ -693,8 +691,7 @@ public class BlockingCommunicator extends Communicator
|
|||||||
// now that we're authenticated, we manage the reading half of things by continuously
|
// now that we're authenticated, we manage the reading half of things by continuously
|
||||||
// reading messages from the socket and processing them
|
// reading messages from the socket and processing them
|
||||||
@Override
|
@Override
|
||||||
protected void iterate ()
|
protected void iterate () {
|
||||||
{
|
|
||||||
DownstreamMessage msg = null;
|
DownstreamMessage msg = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -727,21 +724,18 @@ public class BlockingCommunicator extends Communicator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleIterateFailure (Exception e)
|
protected void handleIterateFailure (Exception e) {
|
||||||
{
|
|
||||||
log.warning("Uncaught exception it reader thread.", e);
|
log.warning("Uncaught exception it reader thread.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void didShutdown ()
|
protected void didShutdown () {
|
||||||
{
|
|
||||||
// let the communicator know when we finally go away
|
// let the communicator know when we finally go away
|
||||||
readerDidExit();
|
readerDidExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void kick ()
|
protected void kick () {
|
||||||
{
|
|
||||||
// we want to interrupt the reader thread as it may be blocked listening to the socket;
|
// we want to interrupt the reader thread as it may be blocked listening to the socket;
|
||||||
// this is only called if the reader thread doesn't shut itself down
|
// this is only called if the reader thread doesn't shut itself down
|
||||||
|
|
||||||
@@ -759,21 +753,18 @@ public class BlockingCommunicator extends Communicator
|
|||||||
*/
|
*/
|
||||||
protected class Writer extends LoopingThread
|
protected class Writer extends LoopingThread
|
||||||
{
|
{
|
||||||
public Writer ()
|
public Writer () {
|
||||||
{
|
|
||||||
super("BlockingCommunicator_Writer");
|
super("BlockingCommunicator_Writer");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void shutdown ()
|
public synchronized void shutdown () {
|
||||||
{
|
|
||||||
// we want to finish off what's in our queue before we actually shutdown
|
// we want to finish off what's in our queue before we actually shutdown
|
||||||
postMessage(new TerminationMessage());
|
postMessage(new TerminationMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void iterate ()
|
protected void iterate () {
|
||||||
{
|
|
||||||
// fetch the next message from the queue
|
// fetch the next message from the queue
|
||||||
UpstreamMessage msg = _msgq.get();
|
UpstreamMessage msg = _msgq.get();
|
||||||
|
|
||||||
@@ -798,14 +789,12 @@ public class BlockingCommunicator extends Communicator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleIterateFailure (Exception e)
|
protected void handleIterateFailure (Exception e) {
|
||||||
{
|
|
||||||
log.warning("Uncaught exception it writer thread.", e);
|
log.warning("Uncaught exception it writer thread.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void didShutdown ()
|
protected void didShutdown () {
|
||||||
{
|
|
||||||
writerDidExit();
|
writerDidExit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -815,14 +804,12 @@ public class BlockingCommunicator extends Communicator
|
|||||||
*/
|
*/
|
||||||
protected class DatagramReader extends LoopingThread
|
protected class DatagramReader extends LoopingThread
|
||||||
{
|
{
|
||||||
public DatagramReader ()
|
public DatagramReader () {
|
||||||
{
|
|
||||||
super("BlockingCommunicator_DatagramReader");
|
super("BlockingCommunicator_DatagramReader");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void willStart ()
|
protected void willStart () {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
connect();
|
connect();
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
@@ -922,8 +909,7 @@ public class BlockingCommunicator extends Communicator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void iterate ()
|
protected void iterate () {
|
||||||
{
|
|
||||||
DownstreamMessage msg = null;
|
DownstreamMessage msg = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -949,20 +935,17 @@ public class BlockingCommunicator extends Communicator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleIterateFailure (Exception e)
|
protected void handleIterateFailure (Exception e) {
|
||||||
{
|
|
||||||
log.warning("Uncaught exception in datagram reader thread.", e);
|
log.warning("Uncaught exception in datagram reader thread.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void didShutdown ()
|
protected void didShutdown () {
|
||||||
{
|
|
||||||
datagramReaderDidExit();
|
datagramReaderDidExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void kick ()
|
protected void kick () {
|
||||||
{
|
|
||||||
// if we have a selector, wake it up
|
// if we have a selector, wake it up
|
||||||
if (_selector != null) {
|
if (_selector != null) {
|
||||||
_selector.wakeup();
|
_selector.wakeup();
|
||||||
@@ -975,14 +958,12 @@ public class BlockingCommunicator extends Communicator
|
|||||||
*/
|
*/
|
||||||
protected class DatagramWriter extends LoopingThread
|
protected class DatagramWriter extends LoopingThread
|
||||||
{
|
{
|
||||||
public DatagramWriter ()
|
public DatagramWriter () {
|
||||||
{
|
|
||||||
super("BlockingCommunicator_DatagramWriter");
|
super("BlockingCommunicator_DatagramWriter");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void iterate ()
|
protected void iterate () {
|
||||||
{
|
|
||||||
// fetch the next message from the queue
|
// fetch the next message from the queue
|
||||||
UpstreamMessage msg = _dataq.get();
|
UpstreamMessage msg = _dataq.get();
|
||||||
|
|
||||||
@@ -1010,20 +991,17 @@ public class BlockingCommunicator extends Communicator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleIterateFailure (Exception e)
|
protected void handleIterateFailure (Exception e) {
|
||||||
{
|
|
||||||
log.warning("Uncaught exception in datagram writer thread.", e);
|
log.warning("Uncaught exception in datagram writer thread.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void didShutdown ()
|
protected void didShutdown () {
|
||||||
{
|
|
||||||
datagramWriterDidExit();
|
datagramWriterDidExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void kick ()
|
protected void kick () {
|
||||||
{
|
|
||||||
// post a bogus message to the outgoing queue to ensure that the writer thread notices
|
// post a bogus message to the outgoing queue to ensure that the writer thread notices
|
||||||
// that it's time to go
|
// that it's time to go
|
||||||
_dataq.append(new TerminationMessage());
|
_dataq.append(new TerminationMessage());
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ public class AuthingConnection extends PresentsConnection
|
|||||||
((AESAuthRequest)msg).decrypt(_serverSecret);
|
((AESAuthRequest)msg).decrypt(_serverSecret);
|
||||||
|
|
||||||
} catch (ClassCastException cce) {
|
} catch (ClassCastException cce) {
|
||||||
log.warning("Received non-encrypted request during secure " +
|
log.warning(
|
||||||
"authentication process",
|
"Received non-encrypted request during secure authentication process",
|
||||||
"conn", AuthingConnection.this, "msg", msg);
|
"conn", AuthingConnection.this, "msg", msg);
|
||||||
} catch (ClassNotFoundException cnfe) {
|
} catch (ClassNotFoundException cnfe) {
|
||||||
log.warning(
|
log.warning(
|
||||||
|
|||||||
Reference in New Issue
Block a user