def close(self):
    self.purge()
    self._buffer.close()
    self._buffer = None
    self._sock = None
def close(self):
    self.purge()
    self._buffer.close()
    self._buffer = None
    self._sock = None