客户端数据读超时配置,客户端停止读取数据,超时时间后断开相应连接,默认是60秒。
If the client stops reading data, free up the stale client connection after this much time. Default 60.
如果在超时之前读线程被唤醒,pthread_cond _ timedwait的返回值是0。
If the reader thread is awakened before the timeout, the return value from pthread_cond_timedwait will be 0.
如果到超时时间段结束时还没有被唤醒,读线程需要唤醒自身并释放互斥锁。
If not awake otherwise, at the end of the timeout, the reader needs to wake itself up and release the mutex.
接下来,读线程需要确保(这是第二个检查)它等待条件变量的时间不超过指定的超时时间。
Next, the reader thread needs to ensure (and this is the second check you perform) that it does not wait on the condition variable any more than the specified timeout period.
接下来,读线程需要确保(这是第二个检查)它等待条件变量的时间不超过指定的超时时间。
Next, the reader thread needs to ensure (and this is the second check you perform) that it does not wait on the condition variable any more than the specified timeout period.
应用推荐