comparison Core/DicomNetworking/DicomUserConnection.cpp @ 3706:bd34b6ac5c08 storage-commitment

timeouts in storage commitment SCU and SCP
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Feb 2020 12:24:29 +0100
parents d8b214a46b91
children 56f2397f027a
comparison
equal deleted inserted replaced
3705:d8b214a46b91 3706:bd34b6ac5c08
1617 **/ 1617 **/
1618 1618
1619 { 1619 {
1620 T_ASC_PresentationContextID presID = 0; 1620 T_ASC_PresentationContextID presID = 0;
1621 T_DIMSE_Message message; 1621 T_DIMSE_Message message;
1622 1622
1623 if (!DIMSE_receiveCommand(pimpl_->assoc_, DIMSE_NONBLOCKING, 1, &presID, 1623 const int timeout = pimpl_->dimseTimeout_;
1624 &message, NULL /* no statusDetail */).good() || 1624 if (!DIMSE_receiveCommand(pimpl_->assoc_,
1625 (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout,
1626 &presID, &message, NULL /* no statusDetail */).good() ||
1625 message.CommandField != DIMSE_N_EVENT_REPORT_RSP) 1627 message.CommandField != DIMSE_N_EVENT_REPORT_RSP)
1626 { 1628 {
1627 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 1629 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
1628 "Unable to read N-EVENT-REPORT response from AET: " + remoteAet_); 1630 "Unable to read N-EVENT-REPORT response from AET: " + remoteAet_);
1629 } 1631 }
1748 1750
1749 { 1751 {
1750 T_ASC_PresentationContextID presID = 0; 1752 T_ASC_PresentationContextID presID = 0;
1751 T_DIMSE_Message message; 1753 T_DIMSE_Message message;
1752 1754
1753 if (!DIMSE_receiveCommand(pimpl_->assoc_, DIMSE_NONBLOCKING, 1, &presID, 1755 const int timeout = pimpl_->dimseTimeout_;
1754 &message, NULL /* no statusDetail */).good() || 1756 if (!DIMSE_receiveCommand(pimpl_->assoc_,
1757 (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout,
1758 &presID, &message, NULL /* no statusDetail */).good() ||
1755 message.CommandField != DIMSE_N_ACTION_RSP) 1759 message.CommandField != DIMSE_N_ACTION_RSP)
1756 { 1760 {
1757 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - " 1761 throw OrthancException(ErrorCode_NetworkProtocol, "Storage commitment - "
1758 "Unable to read N-ACTION response from AET: " + remoteAet_); 1762 "Unable to read N-ACTION response from AET: " + remoteAet_);
1759 } 1763 }