Example #1
0
        public void StartInfoThread()
        {
            string hostName = Dns.GetHostName(); // Retrive the Name of HOST

            Console.WriteLine(hostName);
            // Get the IP
            string myIP = Dns.GetHostByName(hostName).AddressList[0].ToString();

            var netThread = NetworkThread.GetInstance();

            rigBusDesc              = N3fjpInfo.Instance;
            rigBusDesc.Command      = "update";
            rigBusDesc.Id           = Guid.NewGuid().ToString();
            rigBusDesc.UdpPort      = netThread.rigBusDesc.UdpPort;
            rigBusDesc.TcpPort      = netThread.rigBusDesc.TcpPort;
            rigBusDesc.MinVersion   = 1;
            rigBusDesc.MaxVersion   = 1;
            rigBusDesc.host         = hostName;
            rigBusDesc.ip           = myIP;
            rigBusDesc.sendSyncInfo = true;
            rigBusDesc.RigType      = "Unknown";
            rigBusDesc.Name         = "n3fjpRig";
            infoThread              = new Thread(SendRigBusInfo);
            infoThread.Start();
        }
Example #2
0
        public static NetworkThread GetInstance()
        {
            if (Instance == null)
            {
                Instance = new NetworkThread();
            }

            return(Instance);
        }