libzt icon indicating copy to clipboard operation
libzt copied to clipboard

Socket error: connect, 0

Open Sardelka9515 opened this issue 3 years ago • 3 comments

Hi. I'm new here. I got these text printed on console when following the C# example, what am I missing? image

And it just stuck there, can someone help me?

This is my code:

        public static void NodeTest()
        {
            var networkId = 0x8056c2e21c000001;
            var node = new ZeroTier.Core.Node();
            node.Start();   // Network activity only begins after calling Start()
            while (!node.Online)
            {
                Thread.Sleep(50);
            }
            Console.WriteLine("Id            : " + node.IdString);
            Console.WriteLine("Version       : " + node.Version);
            Console.WriteLine("PrimaryPort   : " + node.PrimaryPort);
            Console.WriteLine("SecondaryPort : " + node.SecondaryPort);
            Console.WriteLine("TertiaryPort  : " + node.TertiaryPort);

            node.Join(networkId);
            Console.WriteLine("Waiting for join to complete...");
            while (node.Networks.Count == 0)
            {
                Thread.Sleep(50);
            }
        }

I'm using .NET 6, by the way.

Sardelka9515 avatar Aug 12 '22 07:08 Sardelka9515

What port numbers are you using? Do you have other instances of ZeroTier running on the machine or is there anything blocking traffic on the ports you're using?

joseph-henry avatar Aug 16 '22 19:08 joseph-henry

Thanks for your response.

I didn't specify a port number at first.(says it would randomly attempt if not specified or 0?) Then I tried InitSetPortRange(40000,50000), didn't work, either. I previously had ZeroTier installed, but I tried again after uninstalling it, still the same. Could that be a probem? I'm on a mobile network( 4G), wondering if that might be causing the issue? Although normal ZeroTier installation works perfectly.

Sardelka9515 avatar Aug 17 '22 05:08 Sardelka9515

When will this be resolved?

mistaox avatar Dec 20 '22 03:12 mistaox