必须填写至少10个字的日志
nnhy authored at 2012-07-27 18:48:21
1.76 KiB
X
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace NewLife.PeerToPeer.Messages
{
    /// <summary>
    /// 跟踪消息
    /// </summary>
    public class TrackMessage : TrackMessageBase<TrackMessage>
    {
        /// <summary>消息类型</summary>
        public override MessageTypes MessageType { get { return MessageTypes.Track; } }

        #region 属性
        private Double _Complete;
        /// <summary>完成度</summary>
        public Double Complete
        {
            get { return _Complete; }
            set { _Complete = value; }
        }

        private List<IPAddress> _Private;
        /// <summary>私有地址</summary>
        /// <remarks>客户端自己填写的地址</remarks>
        public virtual List<IPAddress> Private
        {
            get { return _Private; }
            set { _Private = value; }
        }
        #endregion

        #region 响应
        /// <summary>
        /// 邀请响应
        /// </summary>
        public class Response : TrackMessageBase<Response>
        {
            /// <summary>消息类型</summary>
            public override MessageTypes MessageType { get { return MessageTypes.TrackResponse; } }

            private IPEndPoint _Public;
            /// <summary>我的公有地址</summary>
            public IPEndPoint Public
            {
                get { return _Public; }
                set { _Public = value; }
            }

            private List<Peer> _Friends;
            /// <summary>好友</summary>
            public List<Peer> Friends
            {
                get { return _Friends; }
                set { _Friends = value; }
            }
        }
        #endregion
    }
}