コード例 #1
0
        public LMUVViewer(Lumen Lm, NUT Nut, int ShapeIndex, int GraphicIndex)
        {
            lumen        = Lm;
            nut          = Nut;
            shapeIndex   = ShapeIndex;
            graphicIndex = GraphicIndex;

            InitializeComponent();
        }
コード例 #2
0
        public LmuvViewer(Lumen lm, NUT nut, int shapeIndex, int graphicIndex)
        {
            lumen             = lm;
            this.nut          = nut;
            this.shapeIndex   = shapeIndex;
            this.graphicIndex = graphicIndex;

            InitializeComponent();
        }
コード例 #3
0
        //private static readonly IPAddress IpAddress = IPAddress.Parse("192.168.5.137");
        // Listen for activity on all network interfaces
        // https://msdn.microsoft.com/en-us/library/system.net.ipaddress.ipv6any.aspx
        static void Main()
        {
            using (UdpClient socket = new UdpClient(new IPEndPoint(IPAddress.Any, Port)))
            {
                IPEndPoint remoteEndPoint = new IPEndPoint(0, 0);
                while (true)
                {
                    Console.WriteLine("Waiting for broadcast {0}", socket.Client.LocalEndPoint);
                    byte[] datagramReceived = socket.Receive(ref remoteEndPoint);

                    string message = Encoding.ASCII.GetString(datagramReceived, 0, datagramReceived.Length);
                    Console.WriteLine("Receives {0} bytes from {1} port {2} message {3}", datagramReceived.Length,
                                      remoteEndPoint.Address, remoteEndPoint.Port, message);
                    //Parse(message);

                    using (Service1Client client = new Service1Client())
                    {
                        Lumen lumen = new Lumen();
                        lumen.Amount = datagramReceived.Length;
                        client.AddLumen(lumen);
                    }
                }
            }
        }