def handle_close(self): """ Close the connection and clear buffer """ self.data_buff = '' LOGGER.error('%s;Connection closed', self.hostname) self.close() # remove itself from aggregator self.aggregator.pop(self.hostname, None)
def handle_error(self): """ Connection failed """ LOGGER.error('%s;%r', self.hostname, sys.exc_info())