Exemplo n.º 1
0
        void Program_SendMsgToGM01_Event(object socket, string msg)
        {
            Socket tempSock = socket as Socket;

            if (tempSock != null)
            {
                string headContext = string.Empty;
                byte[] msgBytes    = XDCUnity.EnPackageMsg(msg, TcpHead.L2L1, ref headContext);
                tempSock.Send(msgBytes);
            }
        }
Exemplo n.º 2
0
        void Program_SendMsgToeCATEvent(object socket, XDCMessage msg)
        {
            Socket tempSock = socket as Socket;

            if (tempSock != null)
            {
                string headContext = string.Empty;
                byte[] msgBytes    = XDCUnity.EnPackageMsg(msg.MsgASCIIString, TcpHead.L2L1, ref headContext);
                tempSock.Send(msgBytes);
                this.lsb_Log_GM01.Items.Add(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + " :" + "Send(" + (msg.MsgASCIIString.Length).ToString().PadLeft(4, '0') + ") : " + msg.MsgASCIIString);
            }
            this.lsb_Log_GM01.TopIndex = lsb_Log_GM01.Items.Count - (int)(lsb_Log_GM01.Height / lsb_Log_GM01.ItemHeight);
        }