Ejemplo n.º 1
0
        public void Serializes_Pdu()
        {
            var expectedResult = new byte[] {
                0x00, 0x00, 0x00, 0x10,       // length
                0x00, 0x00, 0x00, 0x06,       // command
                0x00, 0x00, 0x00, 0x00,       // status
                0x00, 0x00, 0x00, 0x10,       // sequence
            };
            var pdu = new Unbind(16);

            var serializer = new UnbindSerializer();
            var result = serializer.Serialize(pdu);

            CollectionAssert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 2
0
        internal Task Unbind()
        {
            EnsureBound();
            var sequence = GetNextSequenceNumber();
            var task = _taskRegistry.Register(sequence);
            var pdu = new Unbind(sequence);

            _pduSender.Enqueue(pdu);
            return task.GetTask();
        }
Ejemplo n.º 3
0
 void IPduReceivedHandler.HandlePdu(Unbind pdu)
 {
     var response = new UnbindResponse(SmppStatus.Ok, pdu.SequenceNumber);
     _pduSender.Enqueue(response);
     // TODO: cancel outstanding tasks
     _state = SessionState.Open;
 }