def METHOD_NAME(self, timeout=None):
    expiration = self._expiration_from_timeout(timeout)
    self.wait_for(2, expiration)
    with self._lock:
        (size,) = struct.unpack("!H", self._buffer.get(2))
    self.wait_for(size, expiration)
    with self._lock:
        return self._buffer.get(size)