How to set timeout in client.read function

Hi,
My arduino(Arduino Mega with DHT22 Sensor) sketch is act as a server(Ethernet) and my c# app is act as a Tcp client for sharing Temperature and Humidity values.

If the temperature goes high the client has to send alert to server.Server has to receive alert from client.

After sending temperature and humidity values my server is waiting for long time to receive the alert.I want to set timeout for client.read().

Below is my code

loop()
{
if (client.available() > 0) 
        {
          
           client.print(float(hum),2);
           client.print(float(temp),2);
               
           c=client.read();
           delay(10);
           if(c=="h")

             {
                   
                 n+=c;
                 if (c =='\n')
                 {
                   n=""; 
                 }
                 if(n=="help")
                {
                  digitalWrite(LED_BUILTIN, HIGH);
                  delay(500);
                  digitalWrite(LED_BUILTIN, LOW);
                 }
                 else 
                  {
                   digitalWrite(LED_BUILTIN, LOW);
                 }
}
}

Arduino wasn't kind enough to document it but there is a function client.setTimeout() you can use. The default timeout is 1000 ms, which is an eternity for a microcontroller.

the timeout is only for timed read like readStringUntil. read() doesn't block in proper Stream inplementations