/// <summary> /// Listening is to commence. /// </summary> public void StartListening() { log.Info( string.Format("Listening on port {0} for AE {1}", this.Configuration.Port, this.Configuration.AETitle)); AssocParameters = new ServerAssociationParameters( this.Configuration.AETitle, new IPEndPoint(IPAddress.Any, this.Configuration.Port)); PresentationContextManager.AddPresentationContexts(AssocParameters, this.Configuration.SOPClassRules); // Kicks off into the thread pool. log.Info( string.Format("Launching into dicom server on AE {0} port {1}", AssocParameters.CalledAE, AssocParameters.LocalEndPoint.Port)); DicomServer.StartListening( AssocParameters, (server, assoc) => new StorageListener(Configuration, server, assoc) ); log.Info("Dicom server has been launched"); }
public void WildCard() { var sops = new SimpleDICOMStorageService.Configuration.SOPClassSet() { Name = "all", Rules = new System.Collections.Generic.List <SimpleDICOMStorageService.Configuration.SOPClass>() { new SimpleDICOMStorageService.Configuration.SOPClass() { Uid = "*" } } }; var result = PresentationContextManager.FindMatchingSOPS(sops); var expected = PresentationContextManager.AllSopClasses; expected.Add(SopClass.VerificationSopClass); Assert.IsTrue(result.TrueForAll(t => expected.Exists(s => s.Name == t.Name))); }
public void PartialWildCard() { var sops = new SimpleDICOMStorageService.Configuration.SOPClassSet() { Name = "all", Rules = new System.Collections.Generic.List <SimpleDICOMStorageService.Configuration.SOPClass>() { new SimpleDICOMStorageService.Configuration.SOPClass() { Uid = "1.2.840.10008.5.1.4.1.1.11.*" } } }; var result = PresentationContextManager.FindMatchingSOPS(sops); var expected = new List <SopClass>(); expected.Add(SopClass.VerificationSopClass); expected.Add(SopClass.GrayscaleSoftcopyPresentationStateStorageSopClass); expected.Add(SopClass.BlendingSoftcopyPresentationStateStorageSopClass); Assert.IsTrue(result.TrueForAll(t => expected.Exists(s => s.Name == t.Name))); }