P2P 对于一端的端口为动态端口(Symmetric NAT),优化打洞逻辑#198
Merged
djylb merged 3 commits intodjylb:masterfrom Jan 20, 2026
Merged
Conversation
Owner
|
貌似破坏旧版兼容性了,我想想咋处理。 |
Contributor
Author
不同版本的npc应该是兼容的,只是nps与npc的p2p初步通信有了破坏性更改 |
Owner
没事,不兼容就不兼容吧,大版本号也该加了。我在想要不直接抛开历史包袱直接重构整个p2p部分,把能上的特性一块上了,比如用低ttl避免触发运营商防火墙之类的。 |
Contributor
Author
|
提交后的逻辑,应该基本能完成一端为 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
场景
逻辑
理论概率
PS
TODO
npc nat的命令使用STUN服务器检查nat类型,不过会出现检测不准确的问题,例如检测出类型为Symmetric NAT,实际为固定端口,可以加一个使用nps的p2p服务进行检测