diff --git a/.classpath b/.classpath
index 4c11341e1..8485df73d 100644
--- a/.classpath
+++ b/.classpath
@@ -20,7 +20,7 @@
-
-
+
+
diff --git a/build.xml b/build.xml
index f0084fa30..0733bcbd5 100644
--- a/build.xml
+++ b/build.xml
@@ -6,7 +6,7 @@
-
+
@@ -57,7 +57,7 @@
-
+
@@ -72,6 +72,12 @@
dest="${lib.dir}/somns-deps-dev.jar" />
+
+
+
+
connection;
-
- public BinaryWebSocketHandler(final InetSocketAddress address) {
- super(address, NUM_THREADS);
- connection = new CompletableFuture<>();
- }
-
- @Override
- public void onClose(final WebSocket conn, final int arg1, final String arg2, final boolean arg3) {
- // no-op
- }
-
- @Override
- public void onError(final WebSocket conn, final Exception ex) {
- WebDebugger.log("error:");
- ex.printStackTrace();
- }
-
- @Override
- public void onMessage(final WebSocket conn, final String msg) {
- // no-op
- }
-
- @Override
- public void onOpen(final WebSocket conn, final ClientHandshake handshake) {
- connection.complete(conn);
- }
-
- public CompletableFuture getConnection() {
- return connection;
- }
-}
diff --git a/src/tools/debugger/FrontendConnector.java b/src/tools/debugger/FrontendConnector.java
index ce33b06b5..75f609abc 100644
--- a/src/tools/debugger/FrontendConnector.java
+++ b/src/tools/debugger/FrontendConnector.java
@@ -1,6 +1,7 @@
package tools.debugger;
import java.io.IOException;
+import java.net.BindException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@@ -9,7 +10,7 @@
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
+import java.util.function.Function;
import org.java_websocket.WebSocket;
@@ -27,6 +28,8 @@
import tools.Tagging;
import tools.TraceData;
import tools.concurrency.ActorExecutionTrace;
+import tools.debugger.WebSocketHandler.MessageHandler;
+import tools.debugger.WebSocketHandler.TraceHandler;
import tools.debugger.entities.ActivityType;
import tools.debugger.entities.BreakpointType;
import tools.debugger.entities.EntityType;
@@ -64,15 +67,15 @@ public class FrontendConnector {
/**
* Receives requests from the client.
*/
- private final WebSocketHandler receiver;
- private final BinaryWebSocketHandler binaryHandler;
+ private final MessageHandler messageHandler;
+ private final TraceHandler traceHandler;
/**
* Sends requests to the client.
*/
- private WebSocket sender;
+ private WebSocket messageSocket;
- private WebSocket binarySender;
+ private WebSocket traceSocket;
/**
* Future to await the client's connection.
@@ -81,10 +84,11 @@ public class FrontendConnector {
private final Gson gson;
private static final int MESSAGE_PORT = 7977;
- private static final int BINARY_PORT = 7978;
- private static final int DEBUGGER_PORT = 8888;
+ private static final int TRACE_PORT = 7978;
+ private static final int HTTP_PORT = 8888;
+ private static final int EPHEMERAL_PORT = 0;
- private final ArrayList