This is a local http server which just serves up images. Its job is to take the original image and lower it to screen resolution, because gecko was having so much trouble dealing with hi-res images intended for print publications. While this could have been accomplished just making the img src attribute point to an alternate destination on disk, I did it this way so that we can generate lo-res images in an asynchronous fashion, which will degrade nicely on slower machines. That is, the browser is happy to show the picture later, when it is ready, if it is comming from an http request. In constrast, a file:// is just there or not there... no async about it. Hints To check what's in the url access control list on Vista and up: netsh http show urlacl on XP: httpcfg query urlacl nb: had trouble with 8080. Remember to enable this with (windows 7 up): netsh http add urlacl url=http://localhost:8089/bloom user=everyone on Windows XP, use httpcfg. I haven't tested this, but I think it may be: HTTPCFG set urlacl -u http://+:8089/bloom/ /a D:(A;;GX;;;WD)
Inheritance: Bloom.Api.ServerBase
Exemplo n.º 1
0
        public ProjectContext(string projectSettingsPath, IContainer parentContainer)
        {
            BuildSubContainerForThisProject(projectSettingsPath, parentContainer);

            ProjectWindow = _scope.Resolve <Shell>();

            string collectionDirectory = Path.GetDirectoryName(projectSettingsPath);

            //should we save a link to this in the list of collections?
            var collectionSettings = _scope.Resolve<CollectionSettings>();
            if(collectionSettings.IsSourceCollection)
            {
                AddShortCutInComputersBloomCollections(collectionDirectory);
            }

            if(Path.GetFileNameWithoutExtension(projectSettingsPath).ToLower().Contains("web"))
            {
                BookCollection editableCollection = _scope.Resolve<BookCollection.Factory>()(collectionDirectory, BookCollection.CollectionType.TheOneEditableCollection);
                var sourceCollectionsList = _scope.Resolve<SourceCollectionsList>();
                _bloomServer = new BloomServer(_scope.Resolve<CollectionSettings>(), editableCollection, sourceCollectionsList, _scope.Resolve<HtmlThumbNailer>());
                _bloomServer.Start();
            }
            else
            {
                if (Settings.Default.ImageHandler != "off")
                {
                    _imageServer = _scope.Resolve<ImageServer>();

                    _imageServer.StartWithSetupIfNeeded();
                }
            }
        }
Exemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        public void Dispose()
        {
            _scope.Dispose();
            _scope = null;

            if (_bloomServer != null)
                _bloomServer.Dispose();
            _bloomServer = null;
            if (_imageServer!=null)
                _imageServer.Dispose();
            _imageServer = null;
        }
Exemplo n.º 3
0
 public void RunTwoServer_UseDifferentPorts()
 {
     using(var x = new ImageServer(null))
     {
         x.StartListening();
         var firstUrl = ServerBase.ServerUrl;
         using(var y = new ImageServer(null))
         {
             y.StartListening();
             var secondUrl = ServerBase.ServerUrl;
             Assert.AreNotEqual(firstUrl, secondUrl);
             Console.WriteLine(firstUrl+", "+secondUrl);
         }
     }
 }