mirror of
https://github.com/processing/processing4.git
synced 2026-06-08 08:31:28 +02:00
fixing issue #936 - random hangs when starting new server in js mode
This commit is contained in:
@@ -449,12 +449,13 @@ public class JavaScriptEditor extends Editor
|
||||
* export to folder, start server, open in default browser.
|
||||
*/
|
||||
public void handleStartServer ()
|
||||
{
|
||||
{
|
||||
System.out.println();
|
||||
statusEmpty();
|
||||
System.out.println();
|
||||
|
||||
if ( !handleExport( false ) ) return;
|
||||
|
||||
File serverRoot = getExportFolder();
|
||||
|
||||
// if server hung or something else went wrong .. stop it.
|
||||
if ( jsServer != null &&
|
||||
(!jsServer.isRunning() || !jsServer.getRoot().equals(serverRoot)) )
|
||||
|
||||
@@ -160,7 +160,9 @@ class JavaScriptServer implements HttpConstants, Runnable
|
||||
{
|
||||
server.close();
|
||||
}
|
||||
} catch ( Exception e ) {;}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRunning ()
|
||||
@@ -203,7 +205,7 @@ class JavaScriptServer implements HttpConstants, Runnable
|
||||
if ( server != null )
|
||||
{
|
||||
inited = true;
|
||||
|
||||
|
||||
while ( thread != null )
|
||||
{
|
||||
Socket s = server.accept();
|
||||
|
||||
Reference in New Issue
Block a user