app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpService.java
@@ -7,6 +7,9 @@ import androidx.annotation.Nullable; /** * 本地服务器 */ public class MyNanoHttpService extends Service { private MyNanoHttpServer myNanoHttpServer = MyNanoHttpServer.getInstance(null); @@ -18,6 +21,11 @@ try { myNanoHttpServer.start(); } catch (Exception e) { // if (serverSocket.isBound() && !serverSocket.isClosed()) { // // Port is available // } else { // // Port is not available // } e.printStackTrace(); startService(new Intent(this, MyNanoHttpService.class)); }