diff Core/DicomNetworking/Internals/MoveScp.cpp @ 3704:58f92b1c8061

Fix issue #167 (Job can't be cancelled - Handling of timeouts after established association)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Feb 2020 11:25:57 +0100
parents 94f4a18a79cc
children 2a170a8f1faf
line wrap: on
line diff
--- a/Core/DicomNetworking/Internals/MoveScp.cpp	Wed Feb 26 14:36:42 2020 +0100
+++ b/Core/DicomNetworking/Internals/MoveScp.cpp	Thu Feb 27 11:25:57 2020 +0100
@@ -272,7 +272,8 @@
                                  IMoveRequestHandler& handler,
                                  const std::string& remoteIp,
                                  const std::string& remoteAet,
-                                 const std::string& calledAet)
+                                 const std::string& calledAet,
+                                 int timeout)
   {
     MoveScpData data;
     data.target_ = std::string(msg->msg.CMoveRQ.MoveDestination);
@@ -284,8 +285,8 @@
 
     OFCondition cond = DIMSE_moveProvider(assoc, presID, &msg->msg.CMoveRQ, 
                                           MoveScpCallback, &data,
-                                          /*opt_blockMode*/ DIMSE_BLOCKING, 
-                                          /*opt_dimse_timeout*/ 0);
+                                          /*opt_blockMode*/ (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING),
+                                          /*opt_dimse_timeout*/ timeout);
 
     // if some error occured, dump corresponding information and remove the outfile if necessary
     if (cond.bad())