/// <summary> /// 停止服务 /// </summary> /// 时间:2016/6/7 22:54 /// 备注: public void Stop() { listener.Close(); SocketServerStopedEventArgs _arg = new SocketServerStopedEventArgs { Protocol = this.Protocol, SocketServer = this.Endpoint, StopedTime = DateTime.Now }; OnServerStoped.RaiseEvent(this, _arg); }
public void Stop() { if (!IsRunning) { throw new Exception("server is not running"); } ServerSocket.Close(); OnServerStoped?.Invoke(); Init(); }