From c5a877d2aabb8483ad5b7f1ef6233381f68ab9fb Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Tue, 30 Dec 2014 10:48:21 +0800 Subject: [PATCH] new comment --- ikcp.c | 10 ++++++++++ ikcp.h | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ikcp.c b/ikcp.c index 37ae851..7f4e8d7 100644 --- a/ikcp.c +++ b/ikcp.c @@ -1072,6 +1072,16 @@ void ikcp_update(ikcpcb *kcp, IUINT32 current) } +//--------------------------------------------------------------------- +// Determine when should you invoke ikcp_update: +// if there is no ikcp_input/_send calling, you can call ikcp_update +// after millisecs ikcp_check returns, instead of call update repeatly. +// It is important to reduce unnacessary ikcp_update calling. you can +// just call ikcp_update in a very small interval, or you can use it to +// schedule ikcp_update calling (eg. when you are implementing an epoll +// like mechanism, or optimize ikcp_update when handling massive kcp +// connections) +//--------------------------------------------------------------------- IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current) { IUINT32 ts_flush = kcp->ts_flush; diff --git a/ikcp.h b/ikcp.h index 3f0f77a..fda599f 100644 --- a/ikcp.h +++ b/ikcp.h @@ -347,11 +347,11 @@ int ikcp_send(ikcpcb *kcp, const char *buffer, int len); void ikcp_update(ikcpcb *kcp, IUINT32 current); // Determine when should you invoke ikcp_update: -// if there is no incoming low level packet, you can invoke ikcp_update +// if there is no ikcp_input/_send calling, you can call ikcp_update // after millisecs ikcp_check returns, instead of call update repeatly. // It is important to reduce unnacessary ikcp_update calling. you can // just call ikcp_update in a very small interval, or you can use it to -// schedule ikcp_update invoking (eg. when you are implementing an epoll +// schedule ikcp_update calling (eg. when you are implementing an epoll // like mechanism, or optimize ikcp_update when handling massive kcp // connections) IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current);