From 7f5605c5ced2a123e747cb2fdfc3fafbe72dee9f Mon Sep 17 00:00:00 2001 From: imilne Date: Fri, 15 Dec 2006 11:27:30 +0000 Subject: [PATCH] Commented out all logging messages from the pick code to speed up message transfer. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@313 be28352e-c001-0410-b1a7-c7978e42abec --- src/uk/ac/vamsas/client/picking/PickEndPoint.java | 18 +++++++++--------- src/uk/ac/vamsas/client/picking/PickServer.java | 6 +++--- src/uk/ac/vamsas/client/picking/SocketManager.java | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/uk/ac/vamsas/client/picking/PickEndPoint.java b/src/uk/ac/vamsas/client/picking/PickEndPoint.java index e62c79e..ac45278 100644 --- a/src/uk/ac/vamsas/client/picking/PickEndPoint.java +++ b/src/uk/ac/vamsas/client/picking/PickEndPoint.java @@ -37,15 +37,15 @@ class PickEndPoint extends Thread in = new BufferedReader(new InputStreamReader(socket.getInputStream())); // Start the thread to listen for incoming messages - logger.info("CLIENT: connection successful to port " - + socket.getPort() + " via port " + socket.getLocalPort()); +// logger.info("CLIENT: connection successful to port " +// + socket.getPort() + " via port " + socket.getLocalPort()); start(); return true; } catch (Exception e) { - logger.info("CLIENT: connection failed: " + e); + //logger.info("CLIENT: connection failed: " + e); return false; } } @@ -56,7 +56,7 @@ class PickEndPoint extends Thread { String str = message.getRawMessage(); - logger.info("CLIENT: send " + str + " to " + rPort); + //logger.info("CLIENT: send " + str + " to " + rPort); os.write(str); // We use a newline to terminate the message @@ -65,7 +65,7 @@ class PickEndPoint extends Thread } catch (Exception e) { - logger.info("CLIENT: failed to send"); + //logger.info("CLIENT: failed to send"); // TODO: terminate the connection on a failed send or retry? terminate(); @@ -80,7 +80,7 @@ class PickEndPoint extends Thread while (true) { String str = in.readLine(); - logger.info("CLIENT: recv " + str + " from " + rPort); + //logger.info("CLIENT: recv " + str + " from " + rPort); // TODO: Spawn this off into the GUI Event-Dispatch thread... @@ -96,7 +96,7 @@ class PickEndPoint extends Thread { // Means the other end of the connection has (probably died) so we need // terminate this endpoint (if this is server side) - logger.info("CLIENT: read failed: " + e); + //logger.info("CLIENT: read failed: " + e); terminate(); } @@ -107,7 +107,7 @@ class PickEndPoint extends Thread try { socket.close(); } catch (IOException e) {} - logger.info("CLIENT: closing connection to port " + socket.getPort()); + //logger.info("CLIENT: closing connection to port " + socket.getPort()); manager.removeEndPoint(this); } @@ -123,7 +123,7 @@ class PickEndPoint extends Thread } catch (Exception e) { - logger.info("Unable to reconstruct message: " + e); + //logger.info("Unable to reconstruct message: " + e); } return null; diff --git a/src/uk/ac/vamsas/client/picking/PickServer.java b/src/uk/ac/vamsas/client/picking/PickServer.java index 2247049..2590613 100644 --- a/src/uk/ac/vamsas/client/picking/PickServer.java +++ b/src/uk/ac/vamsas/client/picking/PickServer.java @@ -51,7 +51,7 @@ class PickServer extends Thread } catch (IOException e) { - logger.info("SERVER: " + e); + //logger.info("SERVER: " + e); return false; } } @@ -63,7 +63,7 @@ class PickServer extends Thread */ public void run() { - logger.info("SERVER: listening on " + PORT + " - SERVER"); + //logger.info("SERVER: listening on " + PORT + " - SERVER"); // Loop forever, accepting connectons from other clients // TODO: add in the ability to terminate the server if a VAMSAS session @@ -73,7 +73,7 @@ class PickServer extends Thread try { Socket socket = serverSocket.accept(); - logger.info("SERVER: connection detected"); + //logger.info("SERVER: connection detected"); manager.addEndPoint(socket); } diff --git a/src/uk/ac/vamsas/client/picking/SocketManager.java b/src/uk/ac/vamsas/client/picking/SocketManager.java index f4f4ab7..edfd573 100644 --- a/src/uk/ac/vamsas/client/picking/SocketManager.java +++ b/src/uk/ac/vamsas/client/picking/SocketManager.java @@ -64,7 +64,7 @@ public class SocketManager implements IPickManager if (client.openConnection()) { clients.add(client); - logger.info("List now contains " + clients.size() + " client(s)"); + //logger.info("List now contains " + clients.size() + " client(s)"); return true; } @@ -113,8 +113,8 @@ public class SocketManager implements IPickManager if (msgHandler != null) msgHandler.handleMessage(message); - else - logger.info("No handler available to deal with incoming message"); +// else +// logger.info("No handler available to deal with incoming message"); } /** @@ -125,7 +125,7 @@ public class SocketManager implements IPickManager synchronized void removeEndPoint(PickEndPoint client) { clients.remove(client); - logger.info("List now contains " + clients.size() + " client(s)"); + //logger.info("List now contains " + clients.size() + " client(s)"); // If there's no endpoints left, then we've lost all connections and // need to reinitialize @@ -140,7 +140,7 @@ public class SocketManager implements IPickManager { public void run() { - logger.info("Initializing connection..."); + //logger.info("Initializing connection..."); boolean connected = false; // Loop until we can get a connection (one way or the other) -- 1.7.10.2