public void Write(Dimse dimse) { lock(this) { pcid = dimse.pcid(); System.String tsUID = fsm.GetAcceptedTransferSyntaxUID(pcid); if (tsUID == null) { throw new System.SystemException(); } ((Dimse) dimse).TransferSyntaxUID = tsUID; fsm.FireWrite(dimse); if (pDataTF == null) { pDataTF = new PDataTF(fsm.WriteMaxLength); } pDataTF.OpenPDV(pcid, cmd = true); Stream outs = new PDataTFOutputStream(this); Command c = dimse.Command; try { c.Write(outs); } finally { outs.Close(); } if (c.HasDataset()) { pDataTF.OpenPDV(pcid, cmd = false); outs = new PDataTFOutputStream(this); try { dimse.WriteTo(outs, tsUID); } finally { outs.Close(); } } FlushPDataTF(); } }
internal virtual void Write(PDataTF data) { throw new SystemException(); }
public void Write(PDataTF data) { FireWrite(data); try { lock( stream ) { state.Write(data); } } catch (IOException ioe) { if (assocListener != null) assocListener.Error(assoc, ioe); throw ioe; } }
internal override void Write(PDataTF tf) { try { tf.WriteTo(m_fsm.stream); } catch (IOException e) { m_fsm.ChangeState(m_fsm.STA1); throw e; } }
/// <summary> /// Read next DICOM PDU /// </summary> /// <returns></returns> private bool NextPDataTF() { if (buf == null) { buf = new byte[fsm.ReadMaxLength + 6]; } PduI pdu = fsm.Read(timeout, buf); if (pdu is PDataTF) { pDataTF = (PDataTF) pdu; return true; } if (pdu is AReleaseRP) { return false; } if (pdu is AReleaseRQ) { fsm.Write(AReleaseRP.Instance); return false; } if( pdu == null ) return false; throw new PduException("Received " + pdu, (AAbort) pdu); }
public PDV(PDataTF pDataTF, int off) { m_pDataTF = pDataTF; m_off = off; }