示例#1
0
        [InlineData("stratum2+tcp://us.ubiqpool.io:8008", "good")]      //: 3333,443,25
        public async Task ConnectAsync(string url, string expect)
        {
            using var _ = _output.Session();
            var client = new EthStratumClient(new Farm {
            }, 0, 0);

            client.SetConnection(new Uri(url));
            await client.ConnectAsync();

            switch (expect)
            {
            case "bad_resolve":
            case "bad_connect":
                Assert.False(client.IsConnected);
                break;

            case "good":
                Assert.True(client.IsConnected);
                while (client.IsConnected)
                {
                    Thread.Sleep(100);
                }
                break;
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var client = new EthStratumClient(new Farm {
            }, 0, 0);

            //Test(client, "stratum+tcp://[email protected]:3333").Wait();
            //Test(client, "stratum+tcp://eth-eu1.nanopool.org:9999").Wait();
            //Test(client, "stratum+tcp://zec-eu1.nanopool.org:6666").Wait();
            Test(client, "stratum2+tcp://us.ubiqpool.io:8008").Wait();
        }