'Triggered if any of the control operations timeout.
Stop communicating with the failing device.
If the control command was an Iq request, sends a failure
message back to the client.
Arguments:
session         -- The request session id
nodeId          -- The id of the device which timed out'

def _event_comm_timeout(self, session, nodeId):

    if self.sessions[session]['reply']:
        iq = self.xmpp.Iq()
        iq['from'] = self.sessions[session]['to']
        iq['to'] = self.sessions[session]['from']
        iq['type'] = 'error'
        iq['id'] = self.sessions[session]['seqnr']
        iq['setResponse']['responseCode'] = 'OtherError'
        iq['setResponse'].add_node(nodeId)
        iq['setResponse']['error']['var'] = 'Output'
        iq['setResponse']['error']['text'] = 'Timeout.'
        iq.send(block=False)
    self.sessions[session]['nodeDone'][nodeId] = True
    if self._all_nodes_done(session):
        del self.sessions[session]
