- Timestamp:
- 2013-04-21T12:34:28+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r5861 r5893 2 2 package org.openstreetmap.josm.io.remotecontrol; 3 3 4 import static org.openstreetmap.josm.tools.I18n. tr;4 import static org.openstreetmap.josm.tools.I18n.marktr; 5 5 6 6 import java.io.IOException; … … 10 10 import java.net.SocketException; 11 11 import java.net.InetAddress; 12 13 import org.openstreetmap.josm.Main; 12 14 13 15 /** … … 34 36 stopRemoteControlHttpServer(); 35 37 36 instance = new RemoteControlHttpServer( DEFAULT_PORT);38 instance = new RemoteControlHttpServer(Main.pref.getInteger("remote.control.port", DEFAULT_PORT)); 37 39 instance.start(); 38 40 } catch (BindException ex) { 39 System.err.println(tr("Warning: Cannot start remotecontrol server on port {0}: {1}",40 Integer.toString(DEFAULT_PORT), ex.getLocalizedMessage()) );41 Main.warn(marktr("Warning: Cannot start remotecontrol server on port {0}: {1}"), 42 Integer.toString(DEFAULT_PORT), ex.getLocalizedMessage()); 41 43 } catch (IOException ioe) { 42 44 ioe.printStackTrace(); … … 72 74 // Also make sure we only listen 73 75 // on the local interface so nobody from the outside can connect! 76 // NOTE: On a dual stack machine with old Windows OS this may not listen on both interfaces! 74 77 this.server = new ServerSocket(port, 1, 75 InetAddress.getBy Address(new byte[] { 127, 0, 0, 1 }));78 InetAddress.getByName(Main.pref.get("remote.control.host", "localhost"))); 76 79 } 77 80 … … 81 84 public void run() 82 85 { 83 System.out.println("RemoteControl::Accepting connections on port " + server.getLocalPort()); 86 Main.info(marktr("RemoteControl::Accepting connections on port {0}"), 87 Integer.toString(server.getLocalPort())); 84 88 while (true) 85 89 { … … 109 113 { 110 114 server.close(); 111 System.out.println("RemoteControl::Server stopped.");115 Main.info(marktr("RemoteControl::Server stopped.")); 112 116 } 113 117 }
Note:
See TracChangeset
for help on using the changeset viewer.