private void SimplifyServer_ReceiveStringEvent(HslCommunication.Core.Net.AppSession arg1, NetHandle handle, string msg) { if (handle == 1) { simplifyServer.SendMessage(arg1, handle, version.ToString( )); string address = GetAddressByIp(arg1.IpAddress); lognet.WriteInfo($"{arg1.IpAddress.PadRight( 15 )} [{msg.PadRight( 8 )}] [{address}] Demo"); AddDict(address); } else if (handle == 2) { simplifyServer.SendMessage(arg1, random.Next(10000), "这是一条测试的数据:" + random.Next(10000).ToString( )); } else if (handle == 100) { simplifyServer.SendMessage(arg1, handle, version2.ToString( )); string address = GetAddressByIp(arg1.IpAddress); lognet.WriteInfo($"{arg1.IpAddress.PadRight( 15 )} [{msg.PadRight( 8 )}] [{address}] Controls"); AddDict(address); } else if (handle == 1000) { // 返回统计信息 simplifyServer.SendMessage(arg1, handle, GetData( )); } else { simplifyServer.SendMessage(arg1, handle, msg); } }
private void SimplifyServer_ReceiveStringEvent(HslCommunication.Core.Net.AppSession arg1, NetHandle handle, string msg) { if (handle == 1) { simplifyServer.SendMessage(arg1, handle, version.ToString( )); } else { simplifyServer.SendMessage(arg1, handle, msg); } }
private void SimplifyServer_ReceiveStringEvent(HslCommunication.Core.Net.AppSession arg1, NetHandle handle, string msg) { if (handle == 1) { simplifyServer.SendMessage(arg1, handle, version.ToString( )); string address = GetAddressByIp(arg1.IpAddress); lognet.WriteInfo($"{arg1.IpAddress.PadRight( 15 )} [{address}] Run Application"); } else if (handle == 2) { simplifyServer.SendMessage(arg1, random.Next(10000), "这是一条测试的数据:" + random.Next(10000).ToString( )); } else { simplifyServer.SendMessage(arg1, handle, msg); } }