Ejemplo n.º 1
0
        public static ConnectionStatistics operator -(ConnectionStatistics s1, ConnectionStatistics s2)
        {
            ConnectionStatistics c = new ConnectionStatistics(
                s1.PacketsIn - s2.PacketsIn,
                s1.BytesIn - s2.BytesIn,
                s1.PacketsOut - s2.PacketsOut,
                s1.BytesOut - s2.BytesOut,
                s1.UncompressedBytesIn - s2.UncompressedBytesIn,
                s1.UncompressedBytesOut - s2.UncompressedBytesOut
                );

            c.RoundTripTime = s1.RoundTripTime;
            return(c);
        }
Ejemplo n.º 2
0
 public static ConnectionStatistics Convert(NetPeerStatistics n, float rtt)
 {
     if (n != null)
     {
         ConnectionStatistics c = new ConnectionStatistics(
             n.ReceivedPackets, n.ReceivedBytes,
             n.SentPackets, n.SentBytes,
             n.ReceivedBytes, n.SentBytes);
         c.RoundTripTime = rtt;
         return(c);
     }
     else
     {
         ConnectionStatistics c = new ConnectionStatistics();
         c.RoundTripTime = rtt;
         return(c);
     }
 }
Ejemplo n.º 3
0
 public static ConnectionStatistics Convert(NetPeerStatistics n,float rtt)
 {
     if (n != null)
     {
         ConnectionStatistics c = new ConnectionStatistics(
             n.ReceivedPackets, n.ReceivedBytes,
             n.SentPackets, n.SentBytes,
             n.ReceivedBytes, n.SentBytes);
         c.RoundTripTime = rtt;
         return c;
     }
     else
     {
         ConnectionStatistics c = new ConnectionStatistics();
         c.RoundTripTime = rtt;
         return c;
     }
 }
Ejemplo n.º 4
0
 public static ConnectionStatistics operator -(ConnectionStatistics s1,ConnectionStatistics s2)
 {
     ConnectionStatistics c=new ConnectionStatistics(
         s1.PacketsIn - s2.PacketsIn,
         s1.BytesIn - s2.BytesIn,
         s1.PacketsOut - s2.PacketsOut,
         s1.BytesOut - s2.BytesOut,
         s1.UncompressedBytesIn - s2.UncompressedBytesIn,
         s1.UncompressedBytesOut - s2.UncompressedBytesOut
         );
     c.RoundTripTime = s1.RoundTripTime;
     return c;
 }