当前位置: 首页>>代码示例>>C#>>正文


C# DicomServer.Abort方法代码示例

本文整理汇总了C#中ClearCanvas.Dicom.Network.DicomServer.Abort方法的典型用法代码示例。如果您正苦于以下问题:C# DicomServer.Abort方法的具体用法?C# DicomServer.Abort怎么用?C# DicomServer.Abort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClearCanvas.Dicom.Network.DicomServer的用法示例。


在下文中一共展示了DicomServer.Abort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnReceiveRequest


//.........这里部分代码省略.........
                                                                    ? instance.SendStatus.ToString()
                                                                    : instance.ExtendedFailureDescription;
                                                        }

                	                               		if (scu.RemainingSubOperations == 0)
                	                               		{
                	                               			foreach (StorageInstance sop in _theScu.StorageInstanceList)
                	                               			{
                	                               				if ((sop.SendStatus.Status != DicomState.Success)
                	                               				    && (sop.SendStatus.Status != DicomState.Warning))
                	                               					msg.DataSet[DicomTags.FailedSopInstanceUidList].AppendString(sop.SopInstanceUid);
                	                               			}
                	                               			if (scu.Status == ScuOperationStatus.Canceled)
                	                               				status = DicomStatuses.Cancel;
                	                               			else if (scu.Status == ScuOperationStatus.ConnectFailed)
                	                               				status = DicomStatuses.QueryRetrieveMoveDestinationUnknown;
                	                               			else if (scu.FailureSubOperations > 0)
                	                               				status = DicomStatuses.QueryRetrieveSubOpsOneOrMoreFailures;
															else if (!bOnline)
																status = DicomStatuses.QueryRetrieveUnableToPerformSuboperations;
                	                               			else
                	                               				status = DicomStatuses.Success;
                	                               		}
                	                               		else
                	                               		{
                	                               			status = DicomStatuses.Pending;

                	                               			if ((scu.RemainingSubOperations%5) != 0)
                	                               				return;
                	                               			// Only send a RSP every 5 to reduce network load
                	                               		}
                	                               	    server.SendCMoveResponse(presentationId, message.MessageId,
                	                               	                             msg, status,
                	                               	                             (ushort) scu.SuccessSubOperations,
                	                               	                             (ushort) scu.RemainingSubOperations,
                	                               	                             (ushort) scu.FailureSubOperations,
                	                               	                             (ushort) scu.WarningSubOperations,
                                                                                 status == DicomStatuses.QueryRetrieveSubOpsOneOrMoreFailures
                	                               	                                 ? errorComment
                	                               	                                 : string.Empty);
                	                               	    
                	                               	    
                	                               		if (scu.RemainingSubOperations == 0)
                	                               			finalResponseSent = true;
                	                               	};

                    _theScu.AssociationAccepted +=
                        (sender, parms) => AssociationAuditLogger.BeginInstancesTransferAuditLogger(
                            _theScu.StorageInstanceList,
                            parms);
					
                    _theScu.BeginSend(
                        delegate(IAsyncResult ar)
                        	{
								if (_theScu != null)
								{
                                    if (!finalResponseSent)
                                    {
                                        var msg = new DicomMessage();
                                        server.SendCMoveResponse(presentationId, message.MessageId,
                                                                 msg, DicomStatuses.QueryRetrieveSubOpsOneOrMoreFailures,
                                                                 (ushort) _theScu.SuccessSubOperations,
                                                                 0,
                                                                 (ushort) (_theScu.FailureSubOperations + _theScu.RemainingSubOperations),
                                                                 (ushort) _theScu.WarningSubOperations, errorComment);
                                        finalResponseSent = true;
                                    }

									_theScu.EndSend(ar);
									_theScu.Dispose();
									_theScu = null;
								}
                        	},
                        _theScu);

                    return true;
                } // end using()
            } 
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error,e,"Unexpected exception when processing C-MOVE-RQ");
                if (finalResponseSent == false)
                {
                    try
                    {
                        server.SendCMoveResponse(presentationId, message.MessageId, new DicomMessage(),
                                                 DicomStatuses.QueryRetrieveUnableToProcess, e.Message);
                        finalResponseSent = true;
                    }
                    catch (Exception x)
                    {
                        Platform.Log(LogLevel.Error, x,
                                     "Unable to send final C-MOVE-RSP message on association from {0} to {1}",
                                     association.CallingAE, association.CalledAE);
                        server.Abort();
                    }
                }
            }
            return false;
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:101,代码来源:MoveScpExtension.cs


注:本文中的ClearCanvas.Dicom.Network.DicomServer.Abort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。