fix(qconnection): fix port 0 can't be bound repeatedly #322
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.
现今,绑定端口0时会将 地址,端口0 而不是实际的 地址,端口 写进USC_REGISTRY,导致
get_or_create_usc中为端口0特别处理,不违背它的语义,反正端口0每次都是create_new永远不会reuse,别的端口才可能被reuse。如果在外面判断就显得麻烦了,所以在get_or_create_usc中处理
create_new也优化了下,依赖于OS不让重复bind同一地址的特性,不写代码判定是否已经绑定过