Exemplo n.º 1
0
        /// <summary>
        /// 创建多此Ping对象的回送参数
        /// </summary>
        /// <param name="address"></param>
        /// <param name="replys"></param>
        /// <returns></returns>
        protected MultiPingReply CreateReply(IPAddress address, PingReply[] replys)
        {
            Int32 total = replys.Length;
            Int32 loss  = 0;

            foreach (var item in replys)
            {
                if (item.Status != IPStatus.Success)
                {
                    ++loss;
                }
            }
            MultiPingReply result = new MultiPingReply(address, replys, loss, total);

            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 创建多次Ping调用完成事件参数
 /// </summary>
 /// <param name="reply">回应信息</param>
 /// <param name="error">内部错误</param>
 /// <param name="cancelled">是否取消操作标记</param>
 /// <param name="userState">用户状态值</param>
 public MultiPingCompletedEventArgs(MultiPingReply reply, Exception error, bool cancelled, object userState)
     : base(error, cancelled, userState)
 {
     this.Reply = reply;
 }