Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCP support #318

Open
liuhaox1 opened this issue Jan 19, 2022 · 13 comments
Open

KCP support #318

liuhaox1 opened this issue Jan 19, 2022 · 13 comments
Assignees
Labels
enhancement New feature or request needs investigation pending development Requested PR owner to improve code and waiting for the result proposal accepted Proposal has been accepted proposal Proposal for this repo waiting for response waiting for the response from commenter
Milestone

Comments

@liuhaox1
Copy link

目前已经有UDP和TCP协议了,但是如果作为游戏框架的话,如果是做类似王者荣耀之类的MOBA游戏或者FPS游戏的话,显然少了一种中间协议,目前我看goword框架是有kcp协议的,我想出了以后,会有更多人使用

@liuhaox1 liuhaox1 added enhancement New feature or request proposal Proposal for this repo labels Jan 19, 2022
@panjf2000
Copy link
Owner

暂时没有支持 KCP 的计划,goword 是什么?

@panjf2000 panjf2000 added the waiting for response waiting for the response from commenter label Jan 22, 2022
@shedongzhu

This comment was marked as off-topic.

@hakur
Copy link

hakur commented Aug 18, 2023

暂时没有支持 KCP 的计划,goword 是什么?

一年多过去了,老哥改变新意有计划整KCP没,这玩意游戏行业用的。在UDP上做的封装,ARQ,可靠的UDP。 goword目测一楼说的是goworld框架,https://github.com/xiaonanln/goworld

@panjf2000
Copy link
Owner

暂时没有支持 KCP 的计划,goword 是什么?

一年多过去了,老哥改变新意有计划整KCP没,这玩意游戏行业用的。在UDP上做的封装,ARQ,可靠的UDP。 goword目测一楼说的是goworld框架,https://github.com/xiaonanln/goworld

现在 KCP 的 Go 实现我看用的最多的是 kcp-go,我大致看了一下这个库是兼容 Go 的标准库 net 的, 只是还不清楚能不能兼容 gnet 里来,我今年找个时间去研究下,如果可以集成进来的话我就搞一下,否则的话如果 gnet 要支持 KCP 可能就得自己实现一个兼容的 KCP 库,那成本就不小了,不过也许能参考复用(严格遵循开源 license)一下 kcp-go 的部分源码,总之我要花点时间研究下。

@panjf2000 panjf2000 added working on it pending development Requested PR owner to improve code and waiting for the result needs investigation and removed working on it labels Aug 18, 2023
@panjf2000 panjf2000 added this to the v2.4 milestone Aug 18, 2023
@hakur
Copy link

hakur commented Aug 18, 2023

rpcx框架提到了一个kcp的问题:https://doc.rpcx.io/part1/transport.html#kcp

@panjf2000 panjf2000 modified the milestones: v2.4, Long term Mar 14, 2024
@ayamzh
Copy link

ayamzh commented Jul 4, 2024

@panjf2000 老大kcp-go有没有计划兼容进来啊。。这个游戏公司痛点能给解决了就完美了

@gh-translator
Copy link
Collaborator

🤖 Non-English text detected, translating...


@panjf2000 Does the boss kcp-go have any plans to be compatible with it? . It would be perfect if the pain points of this game company can be solved.

@panjf2000
Copy link
Owner

我短期内暂时没时间精力做这个,有业余时间的话我也打算先做一下 TLS 的支持,以及后续的 io_uring 方面的调研。gnet 的重点还是更偏向于解决通用领域的问题,游戏领域能更好地支持我当然很愿意,但是这里还是有优先级, KCP 的优先级低一点。不过可以考虑加到 roadmap 里。如果有熟悉 KCP 的专家想要在 gnet 里实现 KCP 欢迎给我提 PR。

@gh-translator
Copy link
Collaborator

🤖 Non-English text detected, translating...


I don't have the time or energy to do this in the short term. If I have spare time, I plan to do some TLS support first and follow-up io_uring research. The focus of gnet is still more on solving problems in the general field. Of course I would like to have better support in the game field, but there are still priorities here, and KCP has a lower priority. However, you can consider adding it to roadmap. If there are experts who are familiar with KCP and want to implement KCP in gnet, please send me a PR.

@panjf2000 panjf2000 added the proposal accepted Proposal has been accepted label Jul 4, 2024
@panjf2000 panjf2000 changed the title 能否支持KCP协议? KCP support Jul 4, 2024
panjf2000 added a commit that referenced this issue Jul 4, 2024
Copy link

This issue is marked as stale because it has been open for 30 days with no activity.

You should take one of the following actions:

  • Manually close this issue if it is no longer relevant
  • Comment if you have more information to share

This issue will be automatically closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Sep 26, 2024
@panjf2000 panjf2000 removed the stale label Sep 26, 2024
@lesismal
Copy link

rpcx框架提到了一个kcp的问题:https://doc.rpcx.io/part1/transport.html#kcp

@hakur

基于UDP的没办法, 毕竟没有TCP FIN那些, 只能timeout
但是话说回来, 即使是用TCP, timeout几乎也是必须的, 因为(移动)设备切换基站切换wifi, 进电梯失联, 设备掉电等情况都可能导致没有FIN
所以一视同仁不论是什么Conn都加上timeout就好了

@gh-translator
Copy link
Collaborator

🤖 Non-English text detected, translating ...


The rpcx framework mentioned a kcp issue: https://doc.rpcx.io/part1/transport.html#kcp

@hakur

There is no way based on UDP. After all, there is no TCP FIN, so it can only timeout.
But having said that, even if TCP is used, timeout is almost necessary, because (mobile) devices switch base stations and switch wifi, lose contact when entering the elevator, and the device loses power, etc., which may lead to no FIN.
So treat everyone equally, no matter what kind of Conn it is, just add timeout.

Copy link

This issue is marked as stale because it has been open for 30 days with no activity.

You should take one of the following actions:

  • Manually close this issue if it is no longer relevant
  • Comment if you have more information to share

This issue will be automatically closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Nov 17, 2024
@panjf2000 panjf2000 removed the stale label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs investigation pending development Requested PR owner to improve code and waiting for the result proposal accepted Proposal has been accepted proposal Proposal for this repo waiting for response waiting for the response from commenter
Projects
None yet
Development

No branches or pull requests

7 participants