#448·kcp

Is ikcp_check really useful?

Author: jamboreeCreated Oct 13, 2025Updated Oct 13, 2025

The doc for ikcp_check says:

Determine when should you invoke ikcp_update

and in ikcp_check https://github.com/skywind3000/kcp/blob/f4f3a89cc632647dabdcb146932d2afd5591e62e/ikcp.c#L1211 https://github.com/skywind3000/kcp/blob/f4f3a89cc632647dabdcb146932d2afd5591e62e/ikcp.c#L1222 the return timepoint may be less than ts_flush.

However, in ikcp_update https://github.com/skywind3000/kcp/blob/f4f3a89cc632647dabdcb146932d2afd5591e62e/ikcp.c#L1164 https://github.com/skywind3000/kcp/blob/f4f3a89cc632647dabdcb146932d2afd5591e62e/ikcp.c#L1171-L1177

ikcp_flush is called only if the current timepoint is greater or equal to ts_flush, which makes ikcp_check pointless.