Mercurial > hg > orthanc
comparison OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp @ 773:3bd0589af992
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Apr 2014 15:08:51 +0200 |
parents | 31cc399c7762 |
children | 4e3593c3511d |
comparison
equal
deleted
inserted
replaced
772:31cc399c7762 | 773:3bd0589af992 |
---|---|
53 connection_->GetDistantHost() == address && | 53 connection_->GetDistantHost() == address && |
54 connection_->GetDistantPort() == port && | 54 connection_->GetDistantPort() == port && |
55 connection_->GetDistantManufacturer() == manufacturer) | 55 connection_->GetDistantManufacturer() == manufacturer) |
56 { | 56 { |
57 // The current connection can be reused | 57 // The current connection can be reused |
58 LOG(INFO) << "Reusing the previous SCU connection"; | |
58 return; | 59 return; |
59 } | 60 } |
60 | 61 |
61 Close(); | 62 Close(); |
62 | 63 |
90 } | 91 } |
91 | 92 |
92 { | 93 { |
93 boost::mutex::scoped_lock lock(that->mutex_); | 94 boost::mutex::scoped_lock lock(that->mutex_); |
94 if (that->connection_ != NULL && | 95 if (that->connection_ != NULL && |
95 Now() > that->lastUse_ + that->timeBeforeClose_) | 96 Now() >= that->lastUse_ + that->timeBeforeClose_) |
96 { | 97 { |
97 LOG(INFO) << "Closing the global SCU connection after timeout"; | 98 LOG(INFO) << "Closing the global SCU connection after timeout"; |
98 that->Close(); | 99 that->Close(); |
99 } | 100 } |
100 } | 101 } |