Ejemplo n.º 1
0
        /// <summary>
        /// Stops this database
        /// </summary>
        public void Stop()
        {
            // Signal a stop event
            StopEvent.Set();
            WriteThread.Join();

            // Dispose of sqlite connection
            if (Connection.State == ConnectionState.Open)
            {
                Connection.Close();
            }
            Connection.Dispose();
        }
Ejemplo n.º 2
0
        // Stops this peer's associated threads
        internal void Stop()
        {
            // Invoke peer disconnected callback
            Server.OnPeerDisconnected?.Invoke(this, EventArgs.Empty);

            // Set stop event
            StopEvent.Set();

            // Stop write thread
            if (WriteThread.IsAlive)
            {
                WriteThread.Join();
            }

            // Stop client
            Client.Close();
        }