Mercurial > hg > orthanc
comparison Core/DicomNetworking/TimeoutDicomConnectionManager.cpp @ 3920:82e88ff003d7 c-get
merge default -> c-get
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 12 May 2020 14:58:24 +0200 |
parents | ea1d32861cfc |
children |
comparison
equal
deleted
inserted
replaced
3918:dba48c162b7b | 3920:82e88ff003d7 |
---|---|
60 { | 60 { |
61 that_.TouchInternal(); | 61 that_.TouchInternal(); |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 DicomUserConnection& TimeoutDicomConnectionManager::Lock::GetConnection() | 65 DicomStoreUserConnection& TimeoutDicomConnectionManager::Lock::GetConnection() |
66 { | 66 { |
67 if (that_.connection_.get() == NULL) | 67 if (that_.connection_.get() == NULL) |
68 { | 68 { |
69 // The allocation should have been done by "that_.Open()" in the constructor | 69 // The allocation should have been done by "that_.Open()" in the constructor |
70 throw OrthancException(ErrorCode_InternalError); | 70 throw OrthancException(ErrorCode_InternalError); |
85 | 85 |
86 // Mutex must be locked | 86 // Mutex must be locked |
87 void TimeoutDicomConnectionManager::OpenInternal(const std::string& localAet, | 87 void TimeoutDicomConnectionManager::OpenInternal(const std::string& localAet, |
88 const RemoteModalityParameters& remote) | 88 const RemoteModalityParameters& remote) |
89 { | 89 { |
90 DicomAssociationParameters other(localAet, remote); | |
91 | |
90 if (connection_.get() == NULL || | 92 if (connection_.get() == NULL || |
91 !connection_->IsSameAssociation(localAet, remote)) | 93 !connection_->GetParameters().IsEqual(other)) |
92 { | 94 { |
93 connection_.reset(new DicomUserConnection(localAet, remote)); | 95 connection_.reset(new DicomStoreUserConnection(other)); |
94 } | 96 } |
95 } | 97 } |
96 | 98 |
97 | 99 |
98 // Mutex must be locked | 100 // Mutex must be locked |
99 void TimeoutDicomConnectionManager::CloseInternal() | 101 void TimeoutDicomConnectionManager::CloseInternal() |
100 { | 102 { |
101 if (connection_.get() != NULL) | 103 if (connection_.get() != NULL) |
102 { | 104 { |
103 LOG(INFO) << "Closing inactive DICOM association with modality: " | 105 LOG(INFO) << "Closing inactive DICOM association with modality: " |
104 << connection_->GetRemoteApplicationEntityTitle(); | 106 << connection_->GetParameters().GetRemoteModality().GetApplicationEntityTitle(); |
105 | 107 |
106 connection_.reset(NULL); | 108 connection_.reset(NULL); |
107 } | 109 } |
108 } | 110 } |
109 | 111 |