Esempio n. 1
0
        public void Setup()
        {
            var services = new ServiceCollection();

            services.AddFellowOakDicom()
            .AddLogManager <NullLoggerManager>()
            .Configure <DicomClientOptions>(o =>
            {
                o.AssociationLingerTimeoutInMs = 0;
            })
            .Configure <DicomServiceOptions>(o =>
            {
                o.LogDataPDUs      = false;
                o.LogDimseDatasets = false;
                o.MaxPDULength     = 512 * 1024 * 1024;
            });

            var serviceProvider = services.BuildServiceProvider();

            _dicomServerFactory = serviceProvider.GetRequiredService <IDicomServerFactory>();
            _dicomClientFactory = serviceProvider.GetRequiredService <IDicomClientFactory>();

            _rootPath     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            _sampleFile   = DicomFile.Open(Path.Combine(_rootPath, "Data\\GH355.dcm"));
            _cStoreServer = _dicomServerFactory.Create <NopCStoreProvider>(11112);
            _cEchoServer  = _dicomServerFactory.Create <DicomCEchoProvider>(11113);
        }
Esempio n. 2
0
 public Task StartAsync(CancellationToken cancellationToken)
 {
     // preload dictionary to prevent tiemouts
     _       = DicomDictionary.Default;
     _server = _serverFactory.Create <T>(
         Options.Port
         );
     return(Task.CompletedTask);
 }
        public Task StartAsync(CancellationToken cancellationToken)
        {
            // preload dictionary to prevent tiemouts
            _       = DicomDictionary.Default;
            _server = _serverFactory.Create <GeneralPurposeDicomService>(
                Options.Port,
                userState: _serviceBuilder
                );

            return(Task.CompletedTask);
        }