예제 #1
0
def test_01_unbind_rsp_encode():
    "Test UnBindResp encoding"
    
    P = UnBindResp()
    #P.command_id = Integer(command_ids.unbind_resp, 4)
    
    assert '00 00 00 10 80 00 00 06 00 00 00 00 00 00 00 01 ' == hex_convert(P.encode(), 150)
예제 #2
0
 def handle_unbind(self, P):
     """
     Used by the server to handle the incoming unbind request
     """
     if self.state in [SessionState.BOUND_TX, SessionState.BOUND_RX, SessionState.BOUND_TRX]:
         self.state = SessionState.UNBOUND
         R = UnBindResp()
         R.sequence_number = Integer(P.sequence_number.value, 4)
         data = R.encode()
         self.socket.send(data)