}
public void handleProxyEvent(XDebugConnection connection) {
- setDebugConnection(connection);
//System.out.println("* New Connection - XDebug.Target: " + fDebugConnection.getSessionID());
- fThread = new XDebugThread(this);
- fThreads = new IThread[] {fThread};
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
- try {
- started();
- } catch( DebugException e ){
- e.printStackTrace();
- }
+ if (setDebugConnection(connection)) {
+ fThread = new XDebugThread(this);
+ fThreads = new IThread[] {fThread};
+ fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE));
+ try {
+ started();
+ } catch( DebugException e ){
+ e.printStackTrace();
+ }
+ }
}
- private void setDebugConnection(XDebugConnection connection) {
- if (connection != null) {
+ private boolean setDebugConnection(XDebugConnection connection) {
+ if (connection != null && fDebugConnection == null) {
fDebugConnection = connection;
fResponseListener = new ResponseListener(connection);
startListener();
+
+ return true;
+ } else {
+ connection.close();
+
+ return false;
}
}