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.
假设在 zjuconnect运行前之前有一个 “nc” 进程运行,监听相同的 tcp/udp 端口。按理说 zjuconnect 需要报告此端口已被使用并退出,但是由于“nc”使用了“SO_REUSEPORT”和“SO_REUSEADDR”,zjuconnect 仍然可以成功绑定到此端口,但是绑定到该端口的所有套接字的行为是不确定的(https://learn.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse#using-so_reuseaddr) 。因此我们需要在初始化期间检查是否存在任何潜在的端口冲突。
请注意,目前我们使用严格的检查策略,例如假设 nc 监听本地 TCP 地址“192.168.189.123:1234”,而我们想要监听 127.0.0.1:1234,目前使用的策略也会禁止此操作,尽管此操作可能是合法的。
BTW,删除了dockerfile中使用dockerproxy的部分,注释掉了使用goproxy.cn的部分,有需要自行build的可以自行开启