'Stops both daemons of EM on exit.
:param self: An ExtensionManager object
:type self: ExtensionManager
:return: None
:rtype: None'

def on_exit(self):

    self._should_continue = False
    if self._listen_thread.is_alive():
        self._listen_thread.join(3)
    if self._send_thread.is_alive():
        self._send_thread.join(3)
    if self._channelhop_thread.is_alive():
        self._send_thread.join(3)
    try:
        self._socket.close()
    except AttributeError:
        pass
