Exemplo n.º 1
0
 /// <summary>
 /// 检查包是否重复收到
 /// </summary>
 /// <param name="packet">The packet.</param>
 /// <returns></returns>
 public bool IsDuplicated(InPacket packet)
 {
     if (parsers[packet.GetFamily()] != null)
     {
         return(parsers[packet.GetFamily()].IsDuplicate(packet));
     }
     return(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 通过回复包获得请求包
 /// 通过重载Packet的Equals方法,本判断两个不同类型的对象相等。
 /// </summary>
 /// <param name="inPacket">The in packet.</param>
 /// <returns>OutPacket对象,如果没有找到,返回null</returns>
 public OutPacket RetriveSent(InPacket inPacket)
 {
     if (parsers[inPacket.GetFamily()] != null)
     {
         PacketHistory history = parsers[inPacket.GetFamily()].GetHistory();
         if (history != null)
         {
             return(history.RetrieveSent(inPacket));
         }
     }
     return(null);
 }