public static void Send(string msg) { try { // Assembly ass = Assembly.Load(msg); } catch (Exception ex) { ILiveDebug.WriteLine("ex:" + ex.Message); } }
object threadMethod3(object obj) { int i = 0; while (i < 10) { i++; ILiveDebug.WriteLine(DateTime.Now.ToLongTimeString() + ":threadMethod3|" + i); } return(null); }
object threadMethod2(object obj) { int i = 0; while (i < 10) { Thread.Sleep(1000); i++; ILiveDebug.WriteLine(DateTime.Now.ToLongTimeString() + ":threadMethod2|" + i); } return(null); }
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; } } } }
public void OnTcpReceived(string data) { ILiveDebug.WriteLine("OnTcpReceived:" + data); Send(data); }