I have an application that needs to be connected to a specific access point. This access point is not connected to the Internet. when I change the network to โsettingsโ for this new AP, I see that I got the IP address in a few seconds, but it takes 60-70 seconds to display the Wi-Fi symbol in the status bar. when I return to my application, I canโt connect to the AP until this symbol appears. as soon as it appears, the connection works fine, but 60 seconds is a long time to wait for the user. I am using NSStreamManager to switch with AP.
I donโt understand why I canโt connect as soon as the settings display the IP address. I know that the apple does not allow you to control the network settings in the application. Any suggestions would be appreciated.
Additional Information:
To understand the problem, I added a timer loop that starts as soon as I open the application after switching to a new wifi network. it reports reachability status (via apple reachability class) and tries to get the SSID. if these two methods are successful, then it sends a JSON message to the AP using streamManager if it does not call itself again in one second. The plug is available and the SSID is read in the very first cycle (less than 1 second), but the stream manager still needs a balance of 60 seconds. I do not believe that the problem is related to the AP, since the Android version for Android does not cause connection problems.
-(BOOL)didConnect{ NSString *ssidString=[self.serverCommManager fetchSSIDInfo]; NSString *ssidStart=[ssidString substringToIndex:5]; NSLog(@"****:didConnect ssidStart=%@ ",ssidStart); if([ssidStart isEqualToString:@"Ppppp"]){ NSLog(@"****:didConnect isEqual=TRUE"); self.streamManager = [[NSStreamManager alloc] initWithDelegate:self]; [self.streamManager connectToHost:PlugHostName onPort:PlugPort withMessage: [JSONQuery queryIsPlug]]; [self removeWaitView]; return YES; }else{ NSLog(@"****:PlugSetupTVC didConnect isEqual=FALSE"); [self startTimingWithInterval:1]; return NO; } }
source share