()
| 184 | static Implementation implementation; |
| 185 | |
| 186 | @AstroImageJ(reason = "Replace method of cross-instance communication", modified = true) |
| 187 | public static void startServer() { |
| 188 | if (IJ.debugMode) |
| 189 | System.err.println("OtherInstance: starting server"); |
| 190 | try { |
| 191 | var p = Path.of(getStubPath()); |
| 192 | |
| 193 | p.toFile().deleteOnExit();//todo FileLock? |
| 194 | new IPCServer(p, s -> { |
| 195 | try { |
| 196 | INSTANCE.sendArgument(s); |
| 197 | } catch (RemoteException ignored) {} |
| 198 | }); |
| 199 | } catch (IOException e) { |
| 200 | e.printStackTrace(); |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | private static final String OPTIONS = "prefs.options"; |
| 205 | private static final int RUN_SOCKET_LISTENER=1<<22; |
no test coverage detected