comparison OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp @ 1285:5730f374e4e6

Access to called AET and remote AET from Lua scripts
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Feb 2015 15:00:42 +0100
parents 21ea32170764
children 6e7e5ed91c2d
comparison
equal deleted inserted replaced
1284:21ea32170764 1285:5730f374e4e6
48 const std::string& address, 48 const std::string& address,
49 int port, 49 int port,
50 ModalityManufacturer manufacturer) 50 ModalityManufacturer manufacturer)
51 { 51 {
52 if (connection_ != NULL && 52 if (connection_ != NULL &&
53 connection_->GetDistantApplicationEntityTitle() == remoteAet && 53 connection_->GetRemoteApplicationEntityTitle() == remoteAet &&
54 connection_->GetDistantHost() == address && 54 connection_->GetRemoteHost() == address &&
55 connection_->GetDistantPort() == port && 55 connection_->GetRemotePort() == port &&
56 connection_->GetDistantManufacturer() == manufacturer) 56 connection_->GetRemoteManufacturer() == manufacturer)
57 { 57 {
58 // The current connection can be reused 58 // The current connection can be reused
59 LOG(INFO) << "Reusing the previous SCU connection"; 59 LOG(INFO) << "Reusing the previous SCU connection";
60 return; 60 return;
61 } 61 }
62 62
63 Close(); 63 Close();
64 64
65 connection_ = new DicomUserConnection(); 65 connection_ = new DicomUserConnection();
66 connection_->SetLocalApplicationEntityTitle(localAet_); 66 connection_->SetLocalApplicationEntityTitle(localAet_);
67 connection_->SetDistantApplicationEntityTitle(remoteAet); 67 connection_->SetRemoteApplicationEntityTitle(remoteAet);
68 connection_->SetDistantHost(address); 68 connection_->SetRemoteHost(address);
69 connection_->SetDistantPort(port); 69 connection_->SetRemotePort(port);
70 connection_->SetDistantManufacturer(manufacturer); 70 connection_->SetRemoteManufacturer(manufacturer);
71 connection_->Open(); 71 connection_->Open();
72 } 72 }
73 73
74 void ReusableDicomUserConnection::Close() 74 void ReusableDicomUserConnection::Close()
75 { 75 {
177 } 177 }
178 178
179 void ReusableDicomUserConnection::Unlock() 179 void ReusableDicomUserConnection::Unlock()
180 { 180 {
181 if (connection_ != NULL && 181 if (connection_ != NULL &&
182 connection_->GetDistantManufacturer() == ModalityManufacturer_StoreScp) 182 connection_->GetRemoteManufacturer() == ModalityManufacturer_StoreScp)
183 { 183 {
184 // "storescp" from DCMTK has problems when reusing a 184 // "storescp" from DCMTK has problems when reusing a
185 // connection. Always close. 185 // connection. Always close.
186 Close(); 186 Close();
187 } 187 }