From e01efd770fcf79505e854965b16352bff0992910 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 04 一月 2024 14:35:28 +0800 Subject: [PATCH] 2024年01月04日14:35:21 --- app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpService.java | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpService.java b/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpService.java index 748140a..7a06185 100644 --- a/app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpService.java +++ b/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)); } -- Gitblit v1.8.0