public void SocketStart() { try { listener = new NetworkSocket.TcpListener(); listener.Use <WebSocketMiddleware>(); listener.UsePlug <WebSocketPlug>(); listener.Start(8040); Globle.AddDataLog("XDP", Globle.LangController.GetLang("LOG.XDPServerStarted")); } catch (Exception ex) { SocketSwitch.isOn = false; Globle.AddDataLog("XDP", Globle.LangController.GetLang("LOG.XDPServerException", ex.Message, ex.StackTrace)); } }
public void P2PServerStart() { try { P2Plistener = new NetworkSocket.TcpListener(); //P2Plistener.Use<HttpMiddleware>(); P2Plistener.Use <WebSocketServerMiddleware>(); P2Plistener.UsePlug <CustomWSServerPlug>(); P2Plistener.Start(1314); this.P2PServerStatus = true; Program.AppendText("[WSS]本地服务器已经启动"); } catch (Exception ex) { Program.AppendText("[WSS]本地服务器发生错误 " + ex.Message + " : " + ex.StackTrace); } }