Ejemplo n.º 1
0
        public DescriptorServiceHost(ICremaHost cremaHost, DescriptorService service, int port)
            : base(service, new Uri($"net.tcp://localhost:{port}/DescriptorService"))
        {
            var binding = CremaServiceItemHost.CreateNetTcpBinding();

            this.service = service;
            this.AddServiceEndpoint(typeof(IDescriptorService), binding, string.Empty);

#if DEBUG
            if (Environment.OSVersion.Platform != PlatformID.Unix)
            {
                this.Description.Behaviors.Add(new ServiceMetadataBehavior());
                this.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexTcpBinding(), "mex");
            }
#endif
        }
Ejemplo n.º 2
0
        public HttpDescriptorServiceHost(ICremaHost cremaHost, int port, CremaService service)
            : base(cremaHost, typeof(HttpDescriptorService), address, port)
        {
            var binding = CremaServiceItemHost.CreateWebHttpBinding();

            this.service = service;
            var endpoint = this.AddServiceEndpoint(typeof(IHttpDescriptorService), binding, string.Empty);

            endpoint.Behaviors.Add(new WebHttpBehavior());
            this.Description.Behaviors.Add(new InstanceProviderBehavior());

#if DEBUG
            if (Environment.OSVersion.Platform != PlatformID.Unix)
            {
                this.Description.Behaviors.Add(new ServiceMetadataBehavior());
                this.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex");
            }
#endif
        }
Ejemplo n.º 3
0
 public InstanceProvider(CremaServiceItemHost cremaServiceHost)
 {
     this.cremaServiceHost = cremaServiceHost;
 }