So it’s sending a server message to set the value.
And your loop is sending a separate server message for every sample in the buffer… even though messages are local, this is a high-stress way to do things, likely to expose communication breakdowns.
To set every sample in a buffer, fill will be a few thousand times more efficient.
Or, if you’re filling with data and not just a single value, setn can do up to 13000 values in one message. Reducing stress on the network layer by four orders of magnitude is much more likely to be successful.