/// <summary> /// Initializes an instance of <see cref="DicomClient"/>. /// </summary> /// <param name="host">DICOM host.</param> /// <param name="port">Port.</param> /// <param name="useTls">True if TLS security should be enabled, false otherwise.</param> /// <param name="callingAe">Calling Application Entity Title.</param> /// <param name="calledAe">Called Application Entity Title.</param> /// <param name="clientOptions">The options that further modify the behavior of this DICOM client</param> /// <param name="serviceOptions">The options that modify the behavior of the base DICOM service</param> /// <param name="networkManager">The network manager that will be used to connect to the DICOM server</param> /// <param name="logManager">The log manager that will be used to extract a default logger</param> /// <param name="transcoderManager">The transcoder manager that will be used to transcode incoming or outgoing DICOM files</param> public DicomClient(string host, int port, bool useTls, string callingAe, string calledAe, DicomClientOptions clientOptions, DicomServiceOptions serviceOptions, INetworkManager networkManager, ILogManager logManager, ITranscoderManager transcoderManager) { Host = host; Port = port; UseTls = useTls; CallingAe = callingAe; CalledAe = calledAe; ClientOptions = clientOptions; ServiceOptions = serviceOptions; QueuedRequests = new ConcurrentQueue <StrongBox <DicomRequest> >(); AdditionalPresentationContexts = new List <DicomPresentationContext>(); AdditionalExtendedNegotiations = new List <DicomExtendedNegotiation>(); AsyncInvoked = 1; AsyncPerformed = 1; State = new DicomClientIdleState(this); NetworkManager = networkManager ?? throw new ArgumentNullException(nameof(networkManager)); TranscoderManager = transcoderManager ?? throw new ArgumentNullException(nameof(transcoderManager)); LogManager = logManager ?? throw new ArgumentNullException(nameof(logManager)); Logger = logManager.GetLogger("FellowOakDicom.Network"); }
/// <summary> /// Initializes an instance of <see cref="DicomClient"/>. /// </summary> /// <param name="host">DICOM host.</param> /// <param name="port">Port.</param> /// <param name="useTls">True if TLS security should be enabled, false otherwise.</param> /// <param name="callingAe">Calling Application Entity Title.</param> /// <param name="calledAe">Called Application Entity Title.</param> /// <param name="associationRequestTimeoutInMs">Timeout in milliseconds for establishing association.</param> /// <param name="associationReleaseTimeoutInMs">Timeout in milliseconds to break off association</param> /// <param name="associationLingerTimeoutInMs">Timeout in milliseconds to keep open association after all requests have been processed.</param> public DicomClient(string host, int port, bool useTls, string callingAe, string calledAe, int associationRequestTimeoutInMs = DicomClientDefaults.DefaultAssociationRequestTimeoutInMs, int associationReleaseTimeoutInMs = DicomClientDefaults.DefaultAssociationReleaseTimeoutInMs, int associationLingerTimeoutInMs = DicomClientDefaults.DefaultAssociationLingerInMs) { Host = host; Port = port; UseTls = useTls; CallingAe = callingAe; CalledAe = calledAe; AssociationRequestTimeoutInMs = associationRequestTimeoutInMs; AssociationReleaseTimeoutInMs = associationReleaseTimeoutInMs; AssociationLingerTimeoutInMs = associationLingerTimeoutInMs; QueuedRequests = new ConcurrentQueue <StrongBox <DicomRequest> >(); AdditionalPresentationContexts = new List <DicomPresentationContext>(); AsyncInvoked = 1; AsyncPerformed = 1; State = new DicomClientIdleState(this); }
public static Task <IDicomClientState> TransitionToIdleState(this DicomClient dicomClient, DicomClientCancellation cancellation) { var idleState = new DicomClientIdleState(dicomClient); return(dicomClient.Transition(idleState, cancellation)); }