I have 2 questions here:
First, I guess WiFi client.write is a blocking function, isn't it?. Can the experts here confirm?
If so, is there any non-blocking WiFi transmission function?
I did a few experiments of using client.write to transmit data packets of 40, 70, 300 bytes, in which I found a minimum of 400 microseconds delay for that function to finish. That means that ESP32 is not able to work with a device that has sample rate > 2.5k SPS.
In the experiment, the receiving end is a computer that is in the same lab of Nano ESP32, and the WiFi router.
that is a reference for the first Arduino WiFi and not for the ESP32 WiFi library.
ESP32 WiFi library is not documented, but is very similar.
setConnectionTimeout is not documented, but you can always look into the source code of the library