Esempio n. 1
0
 public static void Send(string msg)
 {
     try
     {
         // Assembly ass = Assembly.Load(msg);
     }
     catch (Exception ex)
     {
         ILiveDebug.WriteLine("ex:" + ex.Message);
     }
 }
Esempio n. 2
0
        object threadMethod3(object obj)
        {
            int i = 0;

            while (i < 10)
            {
                i++;
                ILiveDebug.WriteLine(DateTime.Now.ToLongTimeString() + ":threadMethod3|" + i);
            }
            return(null);
        }
Esempio n. 3
0
        object threadMethod2(object obj)
        {
            int i = 0;

            while (i < 10)
            {
                Thread.Sleep(1000);
                i++;
                ILiveDebug.WriteLine(DateTime.Now.ToLongTimeString() + ":threadMethod2|" + i);
            }
            return(null);
        }
Esempio n. 4
0
        public void Listen()
        {
            while (true)
            {
                ILiveDebug.WriteLine("WaitForConnection");
                // SocketErrorCodes codes = tcp.WaitForConnection();
                //   ILiveDebug.WriteLine("ConnectionStatus:" + codes);
                // TcpClient client = tcpServer.AcceptTcpClient();
                while (true)
                {
                    try
                    {
                        //  ILiveDebug.WriteLine("ReceiveData");
                        int i = tcp.ReceiveData();
                        if (i > 0)
                        {
                            string readdata = System.Text.Encoding.GetEncoding(28591).GetString(tcp.IncomingDataBuffer, 0, i);

                            if (this.TcpDataEvent != null)
                            {
                                this.TcpDataEvent(readdata);
                            }
                        }
                        else
                        {
                            Thread.Sleep(1000);
                        }
                    }
                    catch (Exception e)
                    {
                        ILiveDebug.WriteLine("TCPError:" + e.Message);
                        // break;
                    }
                }
            }
        }
Esempio n. 5
0
 public void OnTcpReceived(string data)
 {
     ILiveDebug.WriteLine("OnTcpReceived:" + data);
     Send(data);
 }