private void OneTimeSetup()
        {
            _channelLocator          = _services.Get <IChannelLocator>();
            _channelMethodDescriptor = _services.Get <IChannelMethodDescriptor>();
            _requestActivator        = _services.Get <IChannelMethodRequestActivator>();
            _msgService            = _services.Get <IChannelMessageService>();
            _contextProvider       = _services.Get <IChannelMethodContextProvider>();
            _configuration         = _services.Get <IChannelConfiguration>();
            _authenticationService = _services.Get <IChannelAuthenticationService>();
            _heuristics            = _services.Get <IChannelHeuristics>();

            Debug.Assert(_channelLocator != null);
            Debug.Assert(_channelMethodDescriptor != null);
            Debug.Assert(_requestActivator != null);
            Debug.Assert(_msgService != null);
            Debug.Assert(_contextProvider != null);
            Debug.Assert(_configuration != null);
            Debug.Assert(_authenticationService != null);
            Debug.Assert(_heuristics != null);

            _rootPath = (new FileInfo(AppDomain.CurrentDomain.BaseDirectory)).Directory.Parent.Parent.Parent.FullName;
            DirectoryInfo logsDirectory = new DirectoryInfo(Path.Combine(_rootPath, "Logs"));

            if (!Directory.Exists(logsDirectory.FullName))
            {
                logsDirectory.Create();
            }

            _sessionKeys = new List <Cookie>();
        }
        private void OneTimeSetup(IServiceLocator services)
        {
            Debug.Assert(services != null);
            Debug.Assert(HttpListener.IsSupported);

            _services        = services;
            _channelLocator  = _services.Get <IChannelLocator>();
            _methodHandlers  = _services.Get <IChannelMethodHandlerCollection>();
            _channelHandlers = _services.Get <IChannelHandlerCollection>();

            _rootPath = (new FileInfo(AppDomain.CurrentDomain.BaseDirectory)).Directory.Parent.Parent.Parent.FullName;
            DirectoryInfo logsDirectory = new DirectoryInfo(Path.Combine(_rootPath, "Logs"));

            if (!Directory.Exists(logsDirectory.FullName))
            {
                logsDirectory.Create();
            }
        }