Exemplo n.º 1
0
 def connectionMade(self):
     self.state = 'OPEN'
     log.msg(self.name, 'STATE :', self.state)
     pdu = BindTransceiver(self.getSeq(), **self.defaults)
     log.msg(pdu.get_obj())
     self.incSeq()
     self.sendPDU(pdu)
Exemplo n.º 2
0
 def connectionMade(self):
     self.state = 'OPEN'
     log.msg('%s STATE: %s' % (self.name, self.state))
     pdu = BindTransceiver(self.getSeq(), **self.defaults)
     log.msg(pdu.get_obj())
     self.incSeq()
     self.sendPDU(pdu)
     self._lose_conn = self.callLater(
         self.smpp_bind_timeout, self.lose_unbound_connection, 'BOUND_TRX')
Exemplo n.º 3
0
 def connectionMade(self):
     self.state = 'OPEN'
     log.msg('STATE: %s' % (self.state))
     pdu = BindTransceiver(self.get_seq(), **self.defaults)
     log.msg(pdu.get_obj())
     self.get_next_seq()
     self.send_pdu(pdu)
     self._lose_conn = self.callLater(self.smpp_bind_timeout,
                                      self.lose_unbound_connection,
                                      'BOUND_TRX')
Exemplo n.º 4
0
    def test_bind_mode_TRX(self):
        """
        FakeSMSC can accept tranceiver bind requests.
        """
        fake_smsc = FakeSMSC()
        client = self.successResultOf(self.connect(fake_smsc))
        self.assertEqual(client.received, b"")

        bind_d = fake_smsc.bind()
        yield client.write(BindTransceiver(0).get_bin())
        yield client.write(EnquireLink(1).get_bin())
        self.assertEqual(
            client.received, b"".join([
                BindTransceiverResp(0).get_bin(),
                EnquireLinkResp(1).get_bin()
            ]))
        yield wait0()
        self.successResultOf(bind_d)
Exemplo n.º 5
0
    def test_bind_explicit(self):
        """
        FakeSMSC can bind using a PDU explicitly passed in.
        """
        fake_smsc = FakeSMSC()
        client = self.successResultOf(self.connect(fake_smsc))
        self.assertEqual(client.received, b"")

        bind_d = fake_smsc.bind(BindTransceiver(0).obj)
        yield wait0()
        # Bind response received.
        self.assertNoResult(bind_d)
        self.assertEqual(client.received, BindTransceiverResp(0).get_bin())
        client.received = b""

        yield client.write(EnquireLink(1).get_bin())
        # enquire_link response received.
        self.assertNoResult(bind_d)
        self.assertEqual(client.received, EnquireLinkResp(1).get_bin())

        yield wait0()
        # Bind complete.
        self.successResultOf(bind_d)
Exemplo n.º 6
0
    def test_bind(self):
        """
        FakeSMSC can accept a bind request and respond to the first
        enquire_link.
        """
        fake_smsc = FakeSMSC()
        client = self.successResultOf(self.connect(fake_smsc))
        self.assertEqual(client.received, b"")

        bind_d = fake_smsc.bind()
        yield client.write(BindTransceiver(0).get_bin())
        # Bind response received.
        self.assertNoResult(bind_d)
        self.assertEqual(client.received, BindTransceiverResp(0).get_bin())
        client.received = b""

        yield client.write(EnquireLink(1).get_bin())
        # enquire_link response received.
        self.assertNoResult(bind_d)
        self.assertEqual(client.received, EnquireLinkResp(1).get_bin())

        yield wait0()
        # Bind complete.
        self.successResultOf(bind_d)