public void TestToxBootstrapAndConnectTcp() { var tox = new Tox(new ToxOptions(true, false)); var error = ToxErrorBootstrap.Ok; foreach (var node in Globals.TcpRelays) { bool result = tox.AddTcpRelay(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(); }
public void TestToxProxySocks5() { var options = new ToxOptions(true, ToxProxyType.Socks5, "127.0.0.1", 9050); var tox = new Tox(options); var error = ToxErrorBootstrap.Ok; foreach (var node in Globals.TcpRelays) { bool result = tox.AddTcpRelay(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(); }