From: <ni...@us...> - 2008-04-25 15:02:34
|
Revision: 267 http://mspsim.svn.sourceforge.net/mspsim/?rev=267&view=rev Author: nifi Date: 2008-04-25 08:02:17 -0700 (Fri, 25 Apr 2008) Log Message: ----------- removed debug output Modified Paths: -------------- mspsim/se/sics/mspsim/util/NetworkConnection.java Modified: mspsim/se/sics/mspsim/util/NetworkConnection.java =================================================================== --- mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-04-25 14:54:01 UTC (rev 266) +++ mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-04-25 15:02:17 UTC (rev 267) @@ -56,15 +56,13 @@ */ public class NetworkConnection implements Runnable { - private final static boolean DEBUG = true; + private final static boolean DEBUG = false; private final static int DEFAULT_PORT = 4711; - - ServerSocket serverSocket = null; - - ArrayList<ConnectionThread> connections = new ArrayList<ConnectionThread>(); - + + private ServerSocket serverSocket = null; + private ArrayList<ConnectionThread> connections = new ArrayList<ConnectionThread>(); private PacketListener listener; - + public NetworkConnection() { if (connect(DEFAULT_PORT)) { System.out.println("NetworkConnection: Connected to network..."); @@ -137,8 +135,9 @@ } else if (cthr[i] != source){ try { cthr[i].output.write(receivedData, 0, receivedData.length); + cthr[i].output.flush(); if (DEBUG) { - System.out.println("NetworkConnection: wrote " + receivedData.length + " bytes"); +// System.out.println("NetworkConnection: wrote " + receivedData.length + " bytes"); printPacket(receivedData); } } catch (IOException e) { @@ -151,6 +150,7 @@ } private void printPacket(byte[] data) { + System.out.print("NetworkConnection: "); for (int i = 0, len = data.length; i < len; i++) { System.out.print(Utils.hex8(data[i]) + " "); } @@ -210,7 +210,7 @@ buffer[0] = (byte) (len & 0xff); input.readFully(buffer, 1, len); if (DEBUG) { - System.out.println("NetworkConnection: Read packet with " + len + " bytes"); +// System.out.println("NetworkConnection: Read packet with " + len + " bytes"); printPacket(buffer); } dataReceived(buffer, this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |