#NEWLINE# def sendDisconnect( self , reason , desc ) : #NEWLINE# #INDENT# '\n        Send a disconnect message to the other side and then disconnect.\n\n        @param reason: the reason for the disconnect.  Should be one of the\n                       DISCONNECT_* values.\n        @type reason: C{int}\n        @param desc: a descrption of the reason for the disconnection.\n        @type desc: C{str}\n        ' #NEWLINE# self . sendPacket ( MSG_DISCONNECT , ( ( struct . pack ( '>L' , reason ) + NS ( reason ) ) + NS ( b'' ) ) ) #NEWLINE# log . msg ( ( 'Disconnecting with error, code %s\nreason: %s' % ( reason , desc ) ) ) #NEWLINE# self . transport . loseConnection ( )