Bootstrap() public method

Attempts to bootstrap this Tox instance with a ToxNode. A 'getnodes' request is sent to the given node.
public Bootstrap ( ToxNode node ) : bool
node ToxNode The node to bootstrap off of.
return bool
Esempio n. 1
0
        public void TestToxBootstrapAndConnect()
        {
            var tox = new Tox(_options);
            var error = ToxErrorBootstrap.Ok;

            foreach (var node in Globals.Nodes)
            {
                bool result = tox.Bootstrap(node, out error);
                if (!result || error != ToxErrorBootstrap.Ok)
                    Assert.Fail("Failed to bootstrap, error: {0}, result: {1}", error, result);
            }

            tox.Start();
            while (!tox.IsConnected) { Thread.Sleep(10); }

            Console.WriteLine("Tox connected!");
            tox.Dispose();
        }