I created a sample app, with just 3 buttons, Connect , send msg, disconnect. I am using TCP server on another mobile B, (any available tcp server app or test tool app). and our client app is on mobile A.
Case 1. Both the Mobile A & B, are on same wifi network, app is working fine (connect, disconnect) if both have same internet or does not have any internet over wifi, and client device does not have internet availability on other network, like 4g.
Working
Case 2. Both the Mobile are on same wifi network, but in client app device, Mobile A has 4g connection with internet available, now the app is not connecting with tcp server over wifi network. this wifi network does not have internet connectivity.
Not Working
so case 2 is not working. If devices are on same wifi, and client has other 3g/4g working internet , the app is not connecting over wifi.