Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            HttpServiceAddress other = obj as HttpServiceAddress;

            if (other == null)
            {
                return(false);
            }

            if (!host.Equals(other.Host))
            {
                return(false);
            }
            if (port >= 0 && port != other.Port)
            {
                return(false);
            }

            if (!String.IsNullOrEmpty(path) &&
                !path.Equals(other.Path))
            {
                return(false);
            }

            if (!String.IsNullOrEmpty(query) &&
                !query.Equals(other.Query))
            {
                return(false);
            }

            return(true);
        }
        public byte[] ToBytes(IServiceAddress address)
        {
            HttpServiceAddress httpAddress = (HttpServiceAddress)address;

            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);

            writer.Write(httpAddress.Host);
            writer.Write(httpAddress.Port);
            writer.Write(httpAddress.Path);
            writer.Write(httpAddress.Query);
            return(stream.ToArray());
        }
Exemplo n.º 3
0
        public int CompareTo(HttpServiceAddress address)
        {
            if (address == null)
            {
                return(-1);
            }

            int c = host.CompareTo(address.host);

            if (c != 0)
            {
                return(c);
            }

            c = port.CompareTo(address.port);
            if (c != 0)
            {
                return(c);
            }

            if (path == null && address.path == null)
            {
                return(0);
            }
            if (path == null)
            {
                return(1);
            }

            c = path.CompareTo(address.path);
            if (c != 0)
            {
                return(c);
            }

            if (query == null && address.query == null)
            {
                return(0);
            }
            if (query == null)
            {
                return(1);
            }

            return(query.CompareTo(address.query));
        }
Exemplo n.º 4
0
 public HttpMessageProcessor(HttpServiceConnector connector, HttpServiceAddress address, ServiceType serviceType)
 {
     this.connector   = connector;
     this.address     = address;
     this.serviceType = serviceType;
 }
Exemplo n.º 5
0
 public IMessageProcessor Connect(HttpServiceAddress address, ServiceType serviceType)
 {
     return(new HttpMessageProcessor(this, address, serviceType));
 }
 public IServiceAddress FromString(string s)
 {
     return(HttpServiceAddress.Parse(s));
 }
Exemplo n.º 7
0
 public HttpAdminService(IServiceFactory serviceFactory, HttpServiceAddress address)
     : base(address, new HttpServiceConnector(), serviceFactory)
 {
 }