|
@@ -18,6 +18,7 @@ namespace JLHHJSvr
|
|
|
partial class JLHHJSvr : ServiceBase
|
|
|
{
|
|
|
private TcpListener _tcpListener = null;
|
|
|
+ private LJHttpServer _httpSvr = null;
|
|
|
private static bool running = false;
|
|
|
|
|
|
public JLHHJSvr()
|
|
@@ -95,15 +96,19 @@ namespace JLHHJSvr
|
|
|
protected override void OnStop()
|
|
|
{
|
|
|
running = false;
|
|
|
+ if (_httpSvr != null)
|
|
|
+ {
|
|
|
+ _httpSvr.Stop();
|
|
|
+ }
|
|
|
}
|
|
|
private void startHttpListener(int port)
|
|
|
{
|
|
|
#if DEBUG
|
|
|
- var httpServer = new SimpleHttpServer(port, GlobalVar.server, new GlobalVar.ParkFileModel());
|
|
|
+ _httpSvr = new SimpleHttpServer(port, GlobalVar.server, new GlobalVar.ParkFileModel());
|
|
|
#else
|
|
|
- var httpServer = new SimpleHttpServer(port, GlobalVar.server, new GlobalVar.ParkFileModel());
|
|
|
+ _httpSvr = new SimpleHttpServer(port, GlobalVar.server, new GlobalVar.ParkFileModel());
|
|
|
#endif
|
|
|
- httpServer.Listen();
|
|
|
+ _httpSvr.Listen();
|
|
|
}
|
|
|
}
|
|
|
}
|