Skip to content

Commit

Permalink
reuse the port by default, but easy enough to switch back to the old way
Browse files Browse the repository at this point in the history
  • Loading branch information
Leslie Watkins committed Oct 22, 2016
1 parent 405b642 commit aa77a39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/processing/mode/p5js/p5jsEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

public class p5jsEditor extends Editor {
HttpServer server;
boolean reusePort = true;
boolean showSizeWarning = true;


Expand Down Expand Up @@ -306,8 +307,10 @@ public void handleStop() {
} catch (IOException e) {
e.printStackTrace(); // TODO ignore?
}
stopServer();
statusNotice("Server stopped.");
if (!reusePort) {
stopServer();
statusNotice("Server stopped.");
}
toolbar.deactivateRun();
}

Expand Down
2 changes: 2 additions & 0 deletions src/processing/mode/p5js/server/HttpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public HttpServer(p5jsEditor editor, int port) {


public void start() {
if (thread == null) {

This comment has been minimized.

Copy link
@benfry

benfry Oct 25, 2016

Contributor

Please get the tabs out of there… the usual style guidelines should be followed for this project.

thread = new Thread(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -120,6 +121,7 @@ public void run() {
running = false;
}
});
}
thread.start();
}

Expand Down

0 comments on commit aa77a39

Please sign in to comment.