Closed dev4u closed 2 years ago
This will create a new UdpSocket for every accepted connections. Why do you think that it is the root cause?
因为手机的网络环境发生变化的时候,之前建立的nat映射失效了。不rebind的话发不了数据。 当然,我也承认提交的代码比较粗糙,或许可以先检测网络环境是否有发生变化,再决定要不要rebind,这比较合乎该有的效果。
You should only do this when the connect()
failed: https://github.com/shadowsocks/qtun/blob/master/src/client.rs#L116
@zonyitoo 你替我看看这样修改还有没有问题?
You should only do this when the
connect()
failed: https://github.com/shadowsocks/qtun/blob/master/src/client.rs#L116
已经按照你的建议做了修改。
Can you confirm your fix works now?
Can you confirm your fix works now?
是的,这两天一直在我的手机移动网络下运行着。
Fix the issue that the connection creation fails when the network changes