mirror of
https://github.com/skywind3000/kcp.git
synced 2025-03-14 09:00:06 +08:00
Merge 8ee6b1f15c
into 7f9805887b
This commit is contained in:
commit
7e88bf5d70
3
ikcp.c
3
ikcp.c
@ -1187,7 +1187,7 @@ void ikcp_update(ikcpcb *kcp, IUINT32 current)
|
||||
// schedule ikcp_update (eg. implementing an epoll-like mechanism,
|
||||
// or optimize ikcp_update when handling massive kcp connections)
|
||||
//---------------------------------------------------------------------
|
||||
IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current)
|
||||
IUINT32 ikcp_check(ikcpcb *kcp, IUINT32 current)
|
||||
{
|
||||
IUINT32 ts_flush = kcp->ts_flush;
|
||||
IINT32 tm_flush = 0x7fffffff;
|
||||
@ -1214,6 +1214,7 @@ IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current)
|
||||
const IKCPSEG *seg = iqueue_entry(p, const IKCPSEG, node);
|
||||
IINT32 diff = _itimediff(seg->resendts, current);
|
||||
if (diff <= 0) {
|
||||
kcp->ts_flush = current;
|
||||
return current;
|
||||
}
|
||||
if (diff < tm_packet) tm_packet = diff;
|
||||
|
2
ikcp.h
2
ikcp.h
@ -370,7 +370,7 @@ void ikcp_update(ikcpcb *kcp, IUINT32 current);
|
||||
// Important to reduce unnacessary ikcp_update invoking. use it to
|
||||
// schedule ikcp_update (eg. implementing an epoll-like mechanism,
|
||||
// or optimize ikcp_update when handling massive kcp connections)
|
||||
IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current);
|
||||
IUINT32 ikcp_check(ikcpcb *kcp, IUINT32 current);
|
||||
|
||||
// when you received a low level packet (eg. UDP packet), call it
|
||||
int ikcp_input(ikcpcb *kcp, const char *data, long size);
|
||||
|
Loading…
Reference in New Issue
Block a user