Class used for DICOM network communications.
The classes DicomClient"/> and DicomServer inherit from this class, to implement network functionality.
        /// <summary>
        /// Creates an instance of <seealso cref="AssociationStatisticsRecorder"/>
        /// </summary>
        /// <param name="network"></param>
        public AssociationStatisticsRecorder(NetworkBase network)
        {
        	_logInformation = network.LogInformation;

            // hookup network events
            network.AssociationEstablished+=OnAssociationEstablished;
            network.MessageReceived += OnDicomMessageReceived;
            network.MessageSent += OnDicomMessageSent;
            network.AssociationReleased+=OnAssociationReleased;

            string description;
            if (network is DicomClient)
                description = string.Format("DICOM association from {0} [{1}:{2}] to {3} [{4}:{5}]",
                                            network.AssociationParams.CallingAE,
                                            network.AssociationParams.LocalEndPoint.Address,
                                            network.AssociationParams.LocalEndPoint.Port,
                                            network.AssociationParams.CalledAE,
                                            network.AssociationParams.RemoteEndPoint.Address,
                                            network.AssociationParams.RemoteEndPoint.Port);
            else
                description = string.Format("DICOM association from {0} [{1}:{2}] to {3} [{4}:{5}]",
                                            network.AssociationParams.CallingAE,
                                            network.AssociationParams.RemoteEndPoint.Address,
                                            network.AssociationParams.RemoteEndPoint.Port,
                                            network.AssociationParams.CalledAE,
                                            network.AssociationParams.LocalEndPoint.Address,
                                            network.AssociationParams.LocalEndPoint.Port);

            _assocStats = new TransmissionStatistics(description);
        }
Beispiel #2
0
 public PDataTFStream(NetworkBase networkBase, byte pcid, uint max, uint total, bool combineCommandData)
 {
     _command = true;
     _pcid = pcid;
     _max = max;
     _pdu = new PDataTF();
     _buffer = new MemoryStream((int)total + 1024);
     _networkBase = networkBase;
 	_combineCommandData = combineCommandData;
 }
Beispiel #3
0
		public PDataTFStream(NetworkBase networkBase, byte pcid, uint max, bool combineCommandData)
		{
			_command = true;
			_pcid = pcid;
			_max = max;
			_pdu = new PDataTFWrite(max);
			_pdu.CreatePDV(pcid);

			_networkBase = networkBase;
			_combineCommandData = combineCommandData;
			BytesWritten = 0;
		}