We've run into some HTTP request errors, details as follows:
- We're currently at a loss because restarting the app doesn't help, only rebooting the phone restores things to normal.
- Based on tracking data, the occurrence rate for users is about 0.033%, and it's only happening on iOS, Android is fine.
- iOS operating system versions: 14-27 are all affected.
- The same issue appears in Rust, Flutter, and C/C++.
Rust: 2026-07-11-19:39:22.252+0800|F4E26069-2D7E-4D5F-8B53-664E012B2CA7|UPLogDefaultLogger|DEBUG|测试模式|1023629905|[userdomain_rust/rust_userdomain/src/operator/device_ops/refresh_device_list_op.rs:61]query_device_list error: HttpRequstFaild(Reqwest(reqwest::Error { kind: Request, url: "https://zj.haier.net/api-gw/wisdomdevice/device/v11/family/devices?familyId=ALL&filterFlag=false", source: hyper_util::client::legacy::Error(Connect, ConnectError("tcp connect error", 36.156.179.34:443, Os { code: 49, kind: AddrNotAvailable, message: "Can't assign requested address" })) }))
Flutter: 2026-07-11-15:29:02.718371+0800|b2257ae8-f7d8-41d0-8811-2ff1824f95d9|UpPlugins|ERROR|正常模式|1023629905|level:error tag:smart_home msg:getWholeHousePreferenceSetting err: DioException [unknown]: null Error: SocketException: Connection failed (OS Error: Can't assign requested address, errno = 49), address = zj.haier.net, port = 443
C/C++: 2026-07-11-19:39:15.247588+0800|a991af96-bf02-4b94-a437-d4f7efc249ff|uSDK|ERROR|正常模式|1023629905|[CAE][[cae_sock_no_ssl_last_err:869][connect fd 122 ret -1 err 49: Can't assign requested address] ]
- Native iOS HTTP interface requests work fine, for example when using AFNetworking.
Looking for your help~
Native iOS HTTP interface requests work fine
Cool. Thanks for testing that.
You’re using a variety third-party libraries which are likely layered on top of BSD Sockets. Error 49 is EADDRNOTAVAIL, which I usually see when folks are doing weird things things sockets, like UDP. However, in this case you’re making an outgoing TCP connection, and it’s hard to get that error with an outgoing TCP connection when you use BSD Sockets correctly.
Specifically, when making an outgoing TCP connection you should not bind the socket to an address, that is, don’t call bind. This lets the networking stack choose the correct local address based on your destination address.
There are a couple of steps you could take to investigate this:
- You could create a small test project that uses BSD Sockets correctly and see if it has the same problem. If so, that’s something that I can take a look at.
- If it doesn’t, then you’ll need to dig into your third-party libraries to determine the exact sequence of BSD Sockets calls they’re making.
Finally:
- If you prefer working in Swift, you’ll find that calling BSD Sockets directly is a bit of a pain. I have a trivial wrapper that can help with that; see Calling BSD Sockets from Swift. It’s not meant for production code, but it’s great for a test project.
- For advice on how to use BSD Sockets correctly — in general, but of specific importance on Apple platforms — see BSD Sockets best practices in TN3151 Choosing the right networking API.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"