Changeset 4797 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-01-15T21:42:25+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r3707 r4797 2 2 package org.openstreetmap.josm.io.remotecontrol; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.io.IOException; 7 import java.net.BindException; 5 8 import java.net.ServerSocket; 6 9 import java.net.Socket; … … 14 17 * Taken from YWMS plugin by frsantos. 15 18 */ 16 17 19 public class RemoteControlHttpServer extends Thread { 18 20 … … 28 30 * Starts or restarts the HTTP server 29 31 */ 30 public static void restartRemoteControlHttpServer() 31 { 32 try 33 { 34 if (instance != null) 32 public static void restartRemoteControlHttpServer() { 33 try { 34 if (instance != null) { 35 35 instance.stopServer(); 36 } 36 37 37 int port = DEFAULT_PORT; 38 instance = new RemoteControlHttpServer(port); 38 instance = new RemoteControlHttpServer(DEFAULT_PORT); 39 39 instance.start(); 40 } 41 catch(IOException ioe) 42 { 40 } catch (BindException ex) { 41 System.err.println(tr("Warning: Cannot start remotecontrol server on port {0}: {1}", 42 Integer.toString(DEFAULT_PORT), ex.getLocalizedMessage())); 43 } catch (IOException ioe) { 43 44 ioe.printStackTrace(); 44 45 } … … 79 80 if( !server.isClosed() ) 80 81 se.printStackTrace(); 81 }82 } 82 83 catch (IOException ioe) 83 84 {
Note:
See TracChangeset
for help on using the changeset viewer.