Example #1
0
        /// <summary>从另一个对象复制</summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public NetUri CopyFrom(NetUri uri)
        {
            if (uri == null)
            {
                return(this);
            }

            this.Protocol = uri.Protocol;
            this.Host     = uri.Host;
            this.Port     = uri.Port;

            return(this);
        }
Example #2
0
        /// <summary>绑定本地终结点</summary>
        public virtual void Bind()
        {
            if (Disposed) return;

            EnsureCreate();
            var socket = Socket;
            if (socket != null && !socket.IsBound)
            {
                var ep = new IPEndPoint(Address, Port);
                socket.Bind(ep);

                //_LocalUri = _RemoteUri = null;
                _LocalUri = null;
            }
        }
Example #3
0
        /// <summary>从另一个对象复制</summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public NetUri CopyFrom(NetUri uri)
        {
            if (uri == null) return this;

            this.Protocol = uri.Protocol;
            this.Host = uri.Host;
            this.Port = uri.Port;

            return this;
        }