Пример #1
0
        public void AssociateRJ_Write_BytesCorrectlyWritten(byte[] expected, AAssociateRJ reject, string _)
        {
            using var raw    = reject.Write();
            using var stream = new MemoryStream();
            raw.WritePDU(stream);
            var actual = stream.ToArray();

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void AssociateRJ_Read_ReasonGivenByContext(byte[] buffer, AAssociateRJ _, string expected)
        {
            using var raw = new RawPDU(buffer);
            var reject = new AAssociateRJ();

            reject.Read(raw);
            var actual = reject.Reason.ToString();

            Assert.Equal(expected, actual);
        }
Пример #3
0
 internal virtual void Write(AAssociateRJ rj)
 {
     throw new SystemException();
 }
Пример #4
0
 public void Write(AAssociateRJ rj)
 {
     FireWrite(rj);
     try {
         lock (stream) {
             state.Write(rj);
         }
     }
     catch (IOException ioe) {
         if (assocListener != null) {
             assocListener.Error(assoc, ioe);
         }
         throw ioe;
     }
 }
Пример #5
0
 internal override void Write(AAssociateRJ rj)
 {
     try {
         rj.WriteTo(m_fsm.stream);
     }
     catch (IOException e) {
         m_fsm.ChangeState(m_fsm.STA1);
         throw e;
     }
     m_fsm.ChangeState(m_fsm.STA13);
 }
Пример #6
0
        public async Task AssociateRJ_WriteAsync_BytesCorrectlyWritten(byte[] expected, AAssociateRJ reject, string _)
        {
            using (var raw = reject.Write())
                using (var stream = new MemoryStream())
                {
                    await raw.WritePDUAsync(stream);

                    var actual = stream.ToArray();

                    Assert.Equal(expected, actual);
                }
        }