public static void StopServer() { if (IsServerStarted) { server?.Stop(); //Stop the server IsServerStarted = false; } }
/// <summary> /// /// </summary> private void StopServer() { scsServer.ClientConnected -= ServerClientConnected; scsServer.ClientDisconnected -= ServerClientDisconnected; scsServer.Stop(); scsServer = null; Start.LargeGlyph = new BitmapImage(new Uri("Images/Start.png", UriKind.Relative)); }
public bool Stop() { try { _scsServer.Stop(); return(true); } catch { return(false); } }
public Boolean CloseServer() { try { server.Stop(); return(true); } catch { return(false); } }
public void StopServer() { try { _server.Stop(); log.Info("Stopping Server"); } catch (Exception ex) { log.Error("Error when stopping Server", ex); } }
/// <summary> /// 停止服务 /// </summary> public void Stop() { if (config.HttpEnabled) { httpServer.Stop(); } server.Stop(); server.Clients.ClearAll(); container.Dispose(); //停止所有线程 smart.Shutdown(); }
public void Dispose() { try { stop_1s_timer(); _sclients.Clear(); if (_server != null) { _server.Stop(); _server = null; } } catch { } }
public void Start() { _config = ServerConfig.LoadConfig(); _receiver = new ServerReceiver(_server); _server = ScsServerFactory.CreateServer(new ScsTcpEndPoint(_config.Ip, _config.Port)); new ServerLogic(_receiver, _server); _server.ClientConnected += Client_Connected; _server.Start(); Console.WriteLine("Enter something to close server"); Console.ReadLine(); _server.Stop(); }
public void Stop() { try { _logger.Info("Shutting down server..."); foreach (var client in _clients) { client.Value.Disconnect("Server is off"); } _server.Stop(); _clients.Clear(); } finally { _logger.Info("Server is terminated!"); } }
static void Main(string[] args) { IScsServer server = ScsServerFactory.CreateServer(new ScsTcpEndPoint(LISTENING_PORT)); server.WireProtocolFactory = new MyWireProtocolFactory(); server.ClientConnected += Server_ClientConnected; server.ClientDisconnected += Server_ClientDisconnected; server.Start(); //Start the server Console.WriteLine("Server is started successfully. Press enter to stop..."); Console.ReadLine(); //Wait user to press enter // Disconnect all connected client foreach (IScsServerClient client in server.Clients.GetAllItems()) { client.Disconnect(); } server.Stop(); //Stop the server }
public override void StopServer() { _server.Stop(); _server.ClientConnected -= OnServerClientDisconnected; _server.ClientDisconnected -= OnServerClientConnected; }
public void CloseSockets() { _server.Stop(); }
public void Stop() { _server.Stop(); }
public void ShutdownServer() { Log.Info("Shutdown TcpServer..."); Server.Stop(); }
public void Stop() { ScsServer.Stop(); }
public void ShutdownServer() { Logger.WriteLine(LogState.Info, "Shutdown LoginServer..."); Server.Stop(); }
/// <summary> /// Stops service application. /// </summary> public void Stop() => _scsServer.Stop();