-
Notifications
You must be signed in to change notification settings - Fork 40
IPv6 支持有误 #15
Copy link
Copy link
Open
Description
表现为 IPv6 端口并未被绑定,无法接收任何来自 IPv6 的请求。
应该是这里的问题:
phira-mp/phira-mp-server/src/main.rs
Lines 103 to 106 in c3511ac
| let addrs: &[SocketAddr] = &[ | |
| SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), port), | |
| SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), port), | |
| ]; |
phira-mp/phira-mp-server/src/main.rs
Line 113 in c3511ac
| let listener: Server = TcpListener::bind(addrs).await?.into(); |
按照 文档 的说法
If addr yields multiple addresses, bind will be attempted with each of the addresses until one succeeds and returns the listener. If none of the addresses succeed in creating a listener, the error returned from the last attempt (the last address) is returned.
因此事实上只绑定了 v4 端口而并未绑定 v6 端口。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels