/// <summary> /// 发送单聊消息测试 /// </summary> async void SendMessageAsync() { if (!leijun.IsOnline()) { logger.DebugFormat("{0} login fail, quit!", leijun.AppAccount); return; } if (!linbin.IsOnline()) { logger.DebugFormat("{0} login fail, quit!", linbin.AppAccount); return; } String packetId = await leijun.SendMessageAsync(linbin.AppAccount, UTF8Encoding.Default.GetBytes("Are you OK?" + DateTime.Now.ToString("u"))); logger.InfoFormat("SendMessage, {0}-->{1}, PacketId:{2}", leijun.AppAccount, linbin.AppAccount, packetId); Thread.Sleep(100); packetId = await linbin.SendMessageAsync(leijun.AppAccount, UTF8Encoding.Default.GetBytes("I'm OK!" + DateTime.Now.ToString("u"))); logger.InfoFormat("SendMessage, {0}-->{1}, PacketId:{2}", linbin.AppAccount, leijun.AppAccount, packetId); Thread.Sleep(100); }