Beispiel #1
0
        private static void OnClientConnected(object sender, Gurux.Common.ConnectionEventArgs e)
        {
            Console.WriteLine("Client {0} is connected.", e.Info);
            GXNet server = (GXNet)sender;

            try
            {
                GXNet  media  = server.Attach(e.Info);
                Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter));
                thread.Start(media);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #2
0
        internal static void OnOnReceived(object sender, Common.ReceiveEventArgs e)
        {
            Console.WriteLine("Client {0} is connected.", e.SenderInfo);
            GXNet server = (GXNet)sender;

            try
            {
                GXNet  media  = server.Attach(e);
                Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter));
                thread.Start(media);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Beispiel #3
0
        /// <summary>
        /// New client is connected.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private static void OnClientConnected(object sender, Common.ConnectionEventArgs e)
        {
            Console.WriteLine("Client {0} is connected.", e.Info);
            GXNet server = (GXNet)sender;

            try
            {
                using (GXNet cl = server.Attach(e.Info))
                {
                    ReadMeter(cl);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }