Wrapper class for the HTTPListener to allow easier access to the server, for start and stop management and event routing of the actual inbound requests.
Inheritance: IDisposable
Example #1
0
        public void Init()
        {
            if (Instance != null)
            {
                throw new InvalidDataException("HttpListenerBase.Instance has already been set");
            }

            Instance = this;

            var serviceManager = EndpointHost.Config.ServiceManager;

            if (serviceManager != null)
            {
                serviceManager.Init();
                Configure(EndpointHost.Config.ServiceManager.Container);
            }
            else
            {
                Configure(null);
            }

            EndpointHost.AfterInit();
            SetAppDomainData();

            var elapsed = DateTime.UtcNow - this.startTime;

            Log.InfoFormat("Initializing Application took {0}ms", elapsed.TotalMilliseconds);
        }
        public void Init()
        {
            if (Instance != null)
            {
                throw new InvalidDataException("HttpListenerBase.Instance has already been set");
            }

            Instance = this;

            if (this.serviceManager != null)
            {
                serviceManager.Init();
                Configure(serviceManager.Container);
            }
            else
            {
                Configure(null);
            }

            EndpointHost.SetOperationTypes(
                EndpointHost.Config.ServiceController.OperationTypes,
                EndpointHost.Config.ServiceController.AllOperationTypes
                );

            var elapsed = DateTime.Now - this.startTime;

            log.InfoFormat("Initializing Application took {0}ms", elapsed.TotalMilliseconds);
        }
		public void Init()
		{
			if (Instance != null)
			{
				throw new InvalidDataException("HttpListenerBase.Instance has already been set");
			}

			Instance = this;

			if (this.serviceManager != null)
			{
				serviceManager.Init();
				Configure(serviceManager.Container);
			}
			else
			{
				Configure(null);
			}

			EndpointHost.SetOperationTypes(
				EndpointHost.Config.ServiceController.OperationTypes,
				EndpointHost.Config.ServiceController.AllOperationTypes
				);

			var elapsed = DateTime.Now - this.startTime;
			log.InfoFormat("Initializing Application took {0}ms", elapsed.TotalMilliseconds);
		}
        public void Init()
        {
            if (Instance != null)
            {
                throw new InvalidDataException("HttpListenerBase.Instance has already been set");
            }

            Instance = this;

            var serviceManager = EndpointHost.Config.ServiceManager;

            if (serviceManager != null)
            {
                serviceManager.Init();
                Configure(EndpointHost.Config.ServiceManager.Container);
            }
            else
            {
                Configure(null);
            }
            if (serviceManager != null)
            {
                //Required for adhoc services added in Configure()
                serviceManager.ReloadServiceOperations();
                EndpointHost.SetOperationTypes(
                    serviceManager.ServiceOperations,
                    serviceManager.AllServiceOperations
                    );
            }

            EndpointHost.AfterInit();

            var elapsed = DateTime.Now - this.startTime;

            Log.InfoFormat("Initializing Application took {0}ms", elapsed.TotalMilliseconds);
        }
        public virtual void Dispose()
        {
            this.Stop();

            if (EndpointHost.Config.ServiceManager != null)
            {
                EndpointHost.Config.ServiceManager.Dispose();
            }

            Instance = null;
        }