File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,10 @@ import mylib.foo.Bar
8888Scalive uses the [ Attach API] ( https://blogs.oracle.com/CoreJavaTechTips/entry/the_attach_api ) in Java 6
8989to tell the target process to load an [ agent] ( http://javahowto.blogspot.jp/2006/07/javaagent-option.html ) .
9090
91- The agent then creates a REPL interpreter and a TCP server to let the
92- Scalive process interact with the interpreter remotely. The Scalive
93- process acts as a client.
91+ Inside the target progress, the agent creates a REPL interpreter and a
92+ TCP server to let the Scalive process connect and interact with the
93+ interpreter. The Scalive process acts as a TCP client. There are 2 TCP
94+ connections, one for REPL data and one for completion data.
9495
9596Similar projects:
9697
Original file line number Diff line number Diff line change 1111
1212public class Net {
1313 // After this time, the REPL and completer connections should be closed,
14- // to avoid blocking socket reads to infinitely block threads created by Scalive in remote process
14+ // to avoid blocking socket reads to infinitely block threads created by Scalive in target process
1515 private static final int LONG_INACTIVITY = (int ) TimeUnit .HOURS .toMillis (1 );
1616
1717 public static final InetAddress LOCALHOST = getLocalHostAddress ();
@@ -25,7 +25,7 @@ public static int getLocalFreePort() throws Exception {
2525
2626 /**
2727 * {@link SocketTimeoutException} will be thrown if there's no activity for a long time.
28- * This is to avoid blocking reads to block threads infinitely, causing leaks in the remote process.
28+ * This is to avoid blocking reads to block threads infinitely, causing leaks in the target process.
2929 */
3030 public static void throwSocketTimeoutExceptionForLongInactivity (Socket socket ) throws SocketException {
3131 socket .setSoTimeout (LONG_INACTIVITY );
Original file line number Diff line number Diff line change 99
1010class Client {
1111 static void run (int port ) throws Exception {
12- Log .log ("Attach to remote process at port " + port );
12+ Log .log ("Attach to target process at port " + port );
1313 final Socket replSocket = new Socket (Net .LOCALHOST , port );
1414 final Socket completerSocket = new Socket (Net .LOCALHOST , port );
1515
16- // Try to notify the remote process to clean up when the client is terminated
16+ // Try to notify the target process to clean up when the client is terminated
1717 final Runnable socketCleaner = Net .getSocketCleaner (replSocket , completerSocket );
1818 Runtime .getRuntime ().addShutdownHook (new Thread (Client .class .getName () + "-ShutdownHook" ) {
1919 @ Override
Original file line number Diff line number Diff line change @@ -65,8 +65,7 @@ private static void printServerOutput(InputStream in) throws UnsupportedEncoding
6565 System .out .flush ();
6666 }
6767
68- // The loop above is broken when REPL is closed by the remote process;
69- // exit now
68+ // The loop above is broken when REPL is closed by the target process; exit now
7069 System .exit (0 );
7170 }
7271}
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ static void run(
6363
6464 socketCleaner .run ();
6565
66- // Before logging this out, wait a litte for System.out to be restored back to the remote process
66+ // Before logging this out, wait a litte for System.out to be restored back to the target process
6767 Thread .sleep (1000 );
6868 Log .log ("Completer closed" );
6969 }
You can’t perform that action at this time.
0 commit comments