comparison 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
comparison
equal deleted inserted replaced
3702:643b5ee86f92 3704:58f92b1c8061
270 T_DIMSE_Message * msg, 270 T_DIMSE_Message * msg,
271 T_ASC_PresentationContextID presID, 271 T_ASC_PresentationContextID presID,
272 IMoveRequestHandler& handler, 272 IMoveRequestHandler& handler,
273 const std::string& remoteIp, 273 const std::string& remoteIp,
274 const std::string& remoteAet, 274 const std::string& remoteAet,
275 const std::string& calledAet) 275 const std::string& calledAet,
276 int timeout)
276 { 277 {
277 MoveScpData data; 278 MoveScpData data;
278 data.target_ = std::string(msg->msg.CMoveRQ.MoveDestination); 279 data.target_ = std::string(msg->msg.CMoveRQ.MoveDestination);
279 data.lastRequest_ = NULL; 280 data.lastRequest_ = NULL;
280 data.handler_ = &handler; 281 data.handler_ = &handler;
282 data.remoteAet_ = &remoteAet; 283 data.remoteAet_ = &remoteAet;
283 data.calledAet_ = &calledAet; 284 data.calledAet_ = &calledAet;
284 285
285 OFCondition cond = DIMSE_moveProvider(assoc, presID, &msg->msg.CMoveRQ, 286 OFCondition cond = DIMSE_moveProvider(assoc, presID, &msg->msg.CMoveRQ,
286 MoveScpCallback, &data, 287 MoveScpCallback, &data,
287 /*opt_blockMode*/ DIMSE_BLOCKING, 288 /*opt_blockMode*/ (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING),
288 /*opt_dimse_timeout*/ 0); 289 /*opt_dimse_timeout*/ timeout);
289 290
290 // if some error occured, dump corresponding information and remove the outfile if necessary 291 // if some error occured, dump corresponding information and remove the outfile if necessary
291 if (cond.bad()) 292 if (cond.bad())
292 { 293 {
293 OFString temp_str; 294 OFString temp_str;