public void Close() { Debug.LogWarning("关闭服务器"); host.Dispose(); host = null; if (syncIpConnection != null) { syncIpConnection.Dispose(); } }
protected virtual void Dispose(bool disposing) { if (!_disposed) { _disposed = true; //prevent second call to Dispose if (disposing) { _tcpHost.Dispose(); //will dispose of singleton instance _serviceHost } } }