def connection_lost(self, exc):
    'asyncio callback when a connection is closed.'
    if exc:
        logger.warning('Connection lost to {}:{} due to {}'.format(self.dstaddr, self.dstport, exc))
    else:
        logger.debug(('Closed connection to: %s:%d' % (self.dstaddr, self.dstport)))
    self._transport = None
    self.recvbuf = b''
    self.on_close()
asyncio callback when a connection is closed.
def connection_lost(self, exc):
    
    if exc:
        logger.warning('Connection lost to {}:{} due to {}'.format(self.dstaddr, self.dstport, exc))
    else:
        logger.debug(('Closed connection to: %s:%d' % (self.dstaddr, self.dstport)))
    self._transport = None
    self.recvbuf = b
    self.on_close()