Reputation: 1156
Our application relies heavily on TCP/IP communication in the local network. Therefore, the application starts a server socket and accepts incoming connections. This worked flawlessly for a long time and we had no problems with this.
In the last days however, we observed that for some "server iPhones" other devices cannot connect to the server socket of our app. The server does not accept incoming connections and the client times out.
The server and the client are in the same network with 192.168.1.0
address range and 255.255.255.0
subnet mask. The server has the IP 192.168.1.11
and the client has 192.168.1.22
. This is a normal home WIFI network with no special firewall rules. Both devices have mobile data disabled and the "access local network" permission is granted. The server socket is bound to all interfaces (0.0.0.0
).
When the server iPhone is in this faulty state, it seems like it somehow has two ip addresses:
192.168.2.123
and 192.168.1.11
The WIFI preferences report the .1.11
ip address. The Apps however see the .2.123
ip address. I cannot explain where the other ip address comes from and why the device thinks it has this ip address.
I've collected interface diagnosis information on a faulty iPhone and it listed the following interfaces:
en0
-> 192.168.2.123
lo0
-> 127.0.0.1
pdp_ip0
(cellular) -> 192.0.0.2
pdp_ip1
to pdp_ip6
(cellular) -> -/-
ipsec0
to ipsec6
(vpn) -> -/-
llw0
(vpn) -> -/-
awdl0
-> -/-
anpi0
-> -/-
ap1
-> -/-
XHC0
-> -/-
en1
and en2
(wired) -> -/-
utun0
to utun2
(vpn) -> -/-
The correct ip of the device is not listed anywhere in this list.
A reboot helped to temporarily fix this problem. One user reported the same issue again a few hours later after a reboot. Switching off wifi and reconnecting does not solve the problem.
This issue occured on several iPhones with the following specs:
The problem must be on the server side as the client can successfully connect to any other device in the same network.
Note: The app is programmed in flutter but I suspect a general OS problem/configuration as the diagnosis information was collected with a native iOS app. Therefore, I also do not think that sharing code is helpful in this case.
0.0.0.0
?Upvotes: -3
Views: 58