comparison OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 2580:055d7d4a823f jobs

avoid unecessary openings of DICOM connection for C-Store
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 May 2018 09:35:17 +0200
parents 3372c5255333
children 1b6a6d80b6f2
comparison
equal deleted inserted replaced
2577:6783a7c02990 2580:055d7d4a823f
155 std::string moveOriginatorAet_; 155 std::string moveOriginatorAet_;
156 uint16_t moveOriginatorId_; 156 uint16_t moveOriginatorId_;
157 std::auto_ptr<DicomUserConnection> connection_; 157 std::auto_ptr<DicomUserConnection> connection_;
158 std::set<std::string> failedInstances_; 158 std::set<std::string> failedInstances_;
159 159
160 void Open() 160 void CreateConnection()
161 { 161 {
162 if (connection_.get() == NULL) 162 if (connection_.get() == NULL)
163 { 163 {
164 connection_.reset(new DicomUserConnection); 164 connection_.reset(new DicomUserConnection);
165 connection_->SetLocalApplicationEntityTitle(localAet_); 165 connection_->SetLocalApplicationEntityTitle(localAet_);
166 connection_->SetRemoteModality(remote_); 166 connection_->SetRemoteModality(remote_);
167 connection_->Open();
168 } 167 }
169 } 168 }
170 169
171 public: 170 public:
172 StoreScuJob(ServerContext& context) : 171 StoreScuJob(ServerContext& context) :
297 if (IsDone()) 296 if (IsDone())
298 { 297 {
299 return new JobStepResult(JobStepCode_Success); 298 return new JobStepResult(JobStepCode_Success);
300 } 299 }
301 300
302 Open(); 301 CreateConnection();
303 302
304 bool ok = false; 303 bool ok = false;
305 304
306 try 305 try
307 { 306 {