# HG changeset patch # User Sebastien Jodogne # Date 1422968827 -3600 # Node ID 21ea32170764ed0495582043ad367cfa2b56f4a7 # Parent 6066529e34c8f610e394f61cf3a9d7fcc9a2d30d Option "DicomAssociationCloseDelay" to set delay before closing DICOM association diff -r 6066529e34c8 -r 21ea32170764 NEWS --- a/NEWS Tue Feb 03 13:15:46 2015 +0100 +++ b/NEWS Tue Feb 03 14:07:07 2015 +0100 @@ -1,16 +1,20 @@ Pending changes in the mainline =============================== -General -------- +Major +----- * URIs to get all the parents of a given resource in a single REST call * Support of HTTP proxy * Instances without PatientID are now allowed + +Minor +----- * Support of Tudor DICOM in Query/Retrieve * Fix issue 25 (AET with underscore not allowed) +* More flexible "/modify" and "/anonymize" for single instance * Code refactorings -* More flexible "/modify" and "/anonymize" for single instance +* Option "DicomAssociationCloseDelay" to set delay before closing DICOM association Plugins ------- diff -r 6066529e34c8 -r 21ea32170764 OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp --- a/OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp Tue Feb 03 13:15:46 2015 +0100 +++ b/OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp Tue Feb 03 14:07:07 2015 +0100 @@ -152,9 +152,15 @@ Close(); } - void ReusableDicomUserConnection::SetMillisecondsBeforeClose(unsigned int ms) + void ReusableDicomUserConnection::SetMillisecondsBeforeClose(uint64_t ms) { boost::mutex::scoped_lock lock(mutex_); + + if (ms == 0) + { + ms = 1; + } + timeBeforeClose_ = boost::posix_time::milliseconds(ms); } diff -r 6066529e34c8 -r 21ea32170764 OrthancServer/DicomProtocol/ReusableDicomUserConnection.h --- a/OrthancServer/DicomProtocol/ReusableDicomUserConnection.h Tue Feb 03 13:15:46 2015 +0100 +++ b/OrthancServer/DicomProtocol/ReusableDicomUserConnection.h Tue Feb 03 14:07:07 2015 +0100 @@ -88,12 +88,12 @@ virtual ~ReusableDicomUserConnection(); - unsigned int GetMillisecondsBeforeClose() const + uint64_t GetMillisecondsBeforeClose() const { - return static_cast(timeBeforeClose_.total_milliseconds()); + return static_cast(timeBeforeClose_.total_milliseconds()); } - void SetMillisecondsBeforeClose(unsigned int ms); + void SetMillisecondsBeforeClose(uint64_t ms); const std::string& GetLocalApplicationEntityTitle() const; diff -r 6066529e34c8 -r 21ea32170764 OrthancServer/ServerContext.cpp --- a/OrthancServer/ServerContext.cpp Tue Feb 03 13:15:46 2015 +0100 +++ b/OrthancServer/ServerContext.cpp Tue Feb 03 14:07:07 2015 +0100 @@ -81,7 +81,9 @@ pluginsManager_(NULL) { scu_.SetLocalApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")); - //scu_.SetMillisecondsBeforeClose(1); // The connection is always released + + uint64_t s = Configuration::GetGlobalIntegerParameter("DicomAssociationCloseDelay", 5); // In seconds + scu_.SetMillisecondsBeforeClose(s * 1000); // Milliseconds are expected here lua_.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX); lua_.SetHttpProxy(Configuration::GetGlobalStringParameter("HttpProxy", "")); diff -r 6066529e34c8 -r 21ea32170764 Resources/Configuration.json --- a/Resources/Configuration.json Tue Feb 03 13:15:46 2015 +0100 +++ b/Resources/Configuration.json Tue Feb 03 14:07:07 2015 +0100 @@ -216,5 +216,11 @@ // If this option is set to "false", Orthanc will run in index-only // mode. The DICOM files will not be stored on the drive. - "StoreDicom" : true + "StoreDicom" : true, + + // DICOM associations are kept open as long as new DICOM commands + // are issued. This option sets the number of seconds of inactivity + // to wait before automatically closing a DICOM association. If set + // to 0, the connection is closed immediately. + "DicomAssociationCloseDelay" : 5 }