Skip to content

Commit 530b59f

Browse files
committed
Replace "remote process" with "target process" to avoid confusion, because the process should be in the same machine with the Scalive process
1 parent 127f9f4 commit 530b59f

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ import mylib.foo.Bar
8888
Scalive uses the [Attach API](https://blogs.oracle.com/CoreJavaTechTips/entry/the_attach_api) in Java 6
8989
to 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

9596
Similar projects:
9697

src/main/java/scalive/Net.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public 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);

src/main/java/scalive/client/Client.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
class 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

src/main/java/scalive/client/Repl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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
}

src/main/java/scalive/server/Completer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)