trying to debug proxy issues

This commit is contained in:
Ben Fry
2016-12-01 07:26:18 -05:00
parent dc69bc3813
commit f8fce0fc1f
2 changed files with 11 additions and 4 deletions
+9 -4
View File
@@ -57,12 +57,15 @@ public class SingleInstance {
static void startServer(final Base base) {
try {
final ServerSocket ss = new ServerSocket(0, 0, InetAddress.getByName(null));
Messages.log("Opening SingleInstance socket");
final ServerSocket ss =
new ServerSocket(0, 0, InetAddress.getLoopbackAddress());
Preferences.set(SERVER_PORT, "" + ss.getLocalPort());
final String key = "" + Math.random();
Preferences.set(SERVER_KEY, key);
Preferences.save();
Messages.log("Starting SingleInstance thread");
new Thread(new Runnable() {
public void run() {
while (true) {
@@ -119,15 +122,17 @@ public class SingleInstance {
static boolean sendArguments(String[] args) { //, long timeout) {
try {
Messages.log("Checking to see if Processing is already running");
int port = Preferences.getInteger(SERVER_PORT);
String key = Preferences.get(SERVER_KEY);
Socket socket = null;
try {
socket = new Socket(InetAddress.getByName(null), port);
socket = new Socket(InetAddress.getLoopbackAddress(), port);
} catch (Exception ignored) { }
if (socket != null) {
Messages.log("Processing is already running, sending command line");
PrintWriter writer = PApplet.createWriter(socket.getOutputStream());
writer.println(key);
for (String arg : args) {
@@ -138,9 +143,9 @@ public class SingleInstance {
return true;
}
} catch (IOException e) {
System.err.println("Error sending commands to other instance.");
e.printStackTrace();
Messages.loge("Error sending commands to other instance", e);
}
Messages.log("Processing is not already running (or could not connect)");
return false;
}
}
+2
View File
@@ -13,6 +13,8 @@ X replace java.util.logging code with built-in logging
_ blank window on startup where the "welcome" screen should be
_ https://github.com/processing/processing/issues/3933
_ this may be fixed (removed invokeLater() on startup), unconfirmed
_ could not write to temporary directory
_ https://github.com/processing/processing/issues/4757
contrib
X Added the remove filter feature