Stop the server.
()
| 2341 | * Stop the server. |
| 2342 | */ |
| 2343 | public void stop() { |
| 2344 | try { |
| 2345 | safeClose(this.myServerSocket); |
| 2346 | this.asyncRunner.closeAll(); |
| 2347 | if (this.myThread != null) { |
| 2348 | this.myThread.join(); |
| 2349 | } |
| 2350 | } catch (Exception e) { |
| 2351 | NanoHTTPD.LOG.log(Level.SEVERE, "Could not stop all connections", e); |
| 2352 | } |
| 2353 | } |
| 2354 | |
| 2355 | public final boolean wasStarted() { |
| 2356 | return this.myServerSocket != null && this.myThread != null; |