private void butStart_Click(object sender, EventArgs e) { if (ConfigIni()) { AlgorithmClientControl.GetInstance().ConnectServer(aIP, aPort); //JavaClientControl.GetInstance().ConnectServer(jIP, jPort); } }
/// <summary> /// 处理机器人端的消息 /// </summary> /// <param name="code">功能码</param> /// <param name="bytes">正文</param> public async void DealRobotMsg(byte code, byte[] bytes) { await Task.Factory.StartNew(() => { //bas64编码 string base64txt = Convert.ToBase64String(bytes); byte[] base64Bytes = Encoding.UTF8.GetBytes(base64txt); AlgorithmClientControl.GetInstance().SendMsg(code, base64Bytes); }); }