def METHOD_NAME(self, sock, count):
    buf = str.encode('')
    while len(buf) < count:
        chunk = sock.recv(count - len(buf))
        if not chunk:
            break
        buf += chunk
    return buf