Refactor.
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / core / xdebug / XDebugConnection.java
index 96ae5c9..a2b9a03 100644 (file)
@@ -18,15 +18,13 @@ import org.eclipse.core.runtime.IStatus;
  *
  */
 public class XDebugConnection {
-       private int fTransactionID = 0;
+       private int fTransactionID;
        private Socket fDebugSocket;
        private OutputStreamWriter fDebugWriter;
        private DataInputStream fDebugReader;
-
-       protected boolean fInitialized = false;
-       protected boolean fIsClosed = true;
-       
-       protected String fSessionID = "";
+       private boolean fInitialized;
+       private boolean fIsClosed;
+       private String fSessionID;
        
        public String getSessionID() {
                return fSessionID;
@@ -116,6 +114,10 @@ public class XDebugConnection {
        }
 
        private synchronized int _sendRequest(String command, String arguments) {
+               if (fDebugSocket == null) {
+                       return 0;
+               }
+               
                XDebugCorePlugin.log(IStatus.INFO,command+" -i "+fTransactionID+" "+arguments);
                synchronized (fDebugSocket) {
                        try {