mirror of
https://github.com/skywind3000/kcp.git
synced 2025-01-14 12:40:13 +08:00
新增ikcp_setoutput函数
This commit is contained in:
parent
8813e65158
commit
abf9ce1464
7
ikcp.c
7
ikcp.c
@ -292,6 +292,13 @@ ikcpcb* ikcp_create(IUINT32 conv, void *user)
|
|||||||
return kcp;
|
return kcp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
// set output function
|
||||||
|
//---------------------------------------------------------------------
|
||||||
|
void ikcp_setoutput(ikcpcb *kcp, int (*output)(const char *buf, int len, ikcpcb *kcp, void *user))
|
||||||
|
{
|
||||||
|
kcp->output = output;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
// release a new kcpcb
|
// release a new kcpcb
|
||||||
|
3
ikcp.h
3
ikcp.h
@ -333,6 +333,9 @@ extern "C" {
|
|||||||
// output callback can be setup like this: 'kcp->output = my_udp_output'
|
// output callback can be setup like this: 'kcp->output = my_udp_output'
|
||||||
ikcpcb* ikcp_create(IUINT32 conv, void *user);
|
ikcpcb* ikcp_create(IUINT32 conv, void *user);
|
||||||
|
|
||||||
|
// set output function
|
||||||
|
void ikcp_setoutput(ikcpcb *kcp, int (*output)(const char *buf, int len, ikcpcb *kcp, void *user));
|
||||||
|
|
||||||
// release kcp control object
|
// release kcp control object
|
||||||
void ikcp_release(ikcpcb *kcp);
|
void ikcp_release(ikcpcb *kcp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user