comparison OrthancFramework/Sources/DicomNetworking/DicomServer.cpp @ 4793:fc2ba1ce6538

new configuration 'DicomThreadsCount'
author Alain Mazy <am@osimis.io>
date Thu, 30 Sep 2021 15:03:35 +0200
parents 82a314325351
children 22d5b611dea7
comparison
equal deleted inserted replaced
4790:9754d5f2f38a 4793:fc2ba1ce6538
422 #else 422 #else
423 CLOG(INFO, DICOM) << "Orthanc SCP will *not* use DICOM TLS"; 423 CLOG(INFO, DICOM) << "Orthanc SCP will *not* use DICOM TLS";
424 #endif 424 #endif
425 425
426 continue_ = true; 426 continue_ = true;
427 pimpl_->workers_.reset(new RunnableWorkersPool(4)); // Use 4 workers - TODO as a parameter? 427
428 CLOG(INFO, DICOM) << "The embedded DICOM server will use " << threadsCount_ << " threads";
429
430 pimpl_->workers_.reset(new RunnableWorkersPool(threadsCount_));
428 pimpl_->thread_ = boost::thread(ServerThread, this, maximumPduLength_, useDicomTls_); 431 pimpl_->thread_ = boost::thread(ServerThread, this, maximumPduLength_, useDicomTls_);
429 } 432 }
430 433
431 434
432 void DicomServer::Stop() 435 void DicomServer::Stop()
586 589
587 bool DicomServer::IsRemoteCertificateRequired() const 590 bool DicomServer::IsRemoteCertificateRequired() const
588 { 591 {
589 return remoteCertificateRequired_; 592 return remoteCertificateRequired_;
590 } 593 }
594
595 void DicomServer::SetThreadsCount(unsigned int threads)
596 {
597 if (threads == 0)
598 {
599 throw OrthancException(ErrorCode_ParameterOutOfRange);
600 }
601
602 Stop();
603 threadsCount_ = threads;
604 }
605
591 } 606 }