コード例 #1
0
        public static ReportingThread GetInstance()
        {
            if (Instance == null)
            {
                Instance = new ReportingThread();
            }

            return(Instance);
        }
コード例 #2
0
        /// <summary>
        /// The Main
        /// </summary>
        /// <param name="args">The args<see cref="string[]"/></param>
        public static void Main(string[] args)
        {
            int httpPort = IpPorts.TcpPort;


            var url = string.Format("http://+:{0}", httpPort);

            var udpServer       = UdpServer.GetInstance();
            var reportingThread = ReportingThread.GetInstance();

            reportingThread.StartInfoThread();
            StartVirtualRigs();

            WebApp.Start <Startup>(url: url);
            Console.ReadLine();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            int httpPort = IpPorts.TcpPort;
            var url      = string.Format("http://localhost:{0}/", httpPort);

            app = WebApp.Start(url);
            string baseAddress = "http://localhost:9000/";

            // Start OWIN host
            using (WebApp.Start <Startup>(url: baseAddress))
            {
                // Create HttpCient and make a request to api/values
                HttpClient client = new HttpClient();

                var response = client.GetAsync(baseAddress + "api/values").Result;

                Console.WriteLine(response);
                Console.WriteLine(response.Content.ReadAsStringAsync().Result);
                Console.ReadLine();
            }

            var comPort         = "com20";
            var udpServer       = UdpServer.GetInstance();
            var reportingThread = ReportingThread.GetInstance();

            reportingThread.rigBusDesc.ComPort = comPort;
            reportingThread.StartInfoThread();
            var kenwood = new KenwoodEmu();

            kenwood.Id = reportingThread.Id;

            kenwood.OpenPort(comPort);

            var kenwood2 = new KenwoodEmu();

            Console.ReadKey();
        }