Example #1
0
        public void TaskTest()
        {
            Assert.AreEqual(5, loop.QueueWait((MainLoopJob) delegate { return(5); }), "#1");

            ManualResetEvent handle = new ManualResetEvent(false);

            loop.QueueWait((MainLoopTask) delegate { handle.Set(); });
            Assert.IsTrue(handle.WaitOne(5000, true), "#2");
        }
Example #2
0
        public void TaskTest()
        {
            Assert.AreEqual(5, loop.QueueWait(() => 5), "#1");

            ManualResetEvent handle = new ManualResetEvent(false);

            loop.QueueWait(() => handle.Set());
            Assert.IsTrue(handle.WaitOne(5000, true), "#2");
        }
Example #3
0
        public void Dispose()
        {
            if (Disposed)
            {
                return;
            }

            Disposed = true;
            MainLoop.QueueWait((Action) delegate {
                this.DhtEngine.Dispose();
                this.DiskManager.Dispose();
                this.listenManager.Dispose();
                this.localPeerListener.Stop();
                this.localPeerManager.Dispose();
            });
        }
Example #4
0
        internal void Dispose()
        {
            if (Disposed)
            {
                return;
            }

            IOLoop.QueueWait(() => {
                ProcessBufferedIO(true);
                Writer.Dispose();
                Disposed = true;
            });
        }
Example #5
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            disposed = true;
            // FIXME: Ensure everything is written to disk before killing the mainloop.
            IOLoop.QueueWait((MainLoopTask)writer.Dispose);
        }
Example #6
0
        public void Dispose()
        {
            if (Disposed)
            {
                return;
            }

            Disposed = true;
            MainLoop.QueueWait(() => {
                DhtEngine.Dispose();
                DiskManager.Dispose();
                listenManager.Dispose();
                LocalPeerDiscovery.Stop();
            });
        }
        public void Dispose ()
        {
            if (Disposed)
                return;

            Disposed = true;
            MainLoop.QueueWait (() => {
                PeerListener.Stop ();
                listenManager.SetListener (new NullPeerListener ());

                DhtListener.Stop ();
                DhtEngine.Dispose ();

                DiskManager.Dispose ();
                LocalPeerDiscovery.Stop ();
            });
        }
Example #8
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            disposed = true;
            MainLoop.QueueWait((MainLoopTask) delegate {
                this.dhtEngine.Dispose();
                this.diskManager.Dispose();
                this.listenManager.Dispose();
                this.localPeerListener.Stop();
                this.localPeerManager.Dispose();
            });
        }