My SIOSocket get disconneted automatically when i locked my ipad

123 views Asked by At

See this code it automatic goes to onDisconnect event when i locked ipad.Wifi is also turned on while i locked my ipad so is there any solutions?

[SIOSocket socketWithHost: @"https://localHost:3003" response: ^(SIOSocket *socket) { _SocketIO = socket; _SocketIO.onConnect =^() { ISConnected = true; NSLog(@"connected"); [manager Connected];

     };
     [_SocketIO on: @"res" callback: ^(SIOParameterArray *args)
      {
          if ([self.delegate isKindOfClass:[Playing class]])
          {

          }
          [self.delegate ResponcewithDict:[args objectAtIndex:0]];
      }];
     _SocketIO.onConnectError =^(NSDictionary *dict)
     {
         NSLog(@"connection error");
     };

     _SocketIO.onDisconnect=^()
     {
      // [((ViewController *)[AppDelegate sharedInstance].window.rootViewController) onDisconnect];
         ISConnected = false;
         NSLog(@"disconnect");
     };

     _SocketIO.onError=^(NSDictionary *dict)
     {
         NSLog(@"error");
         ISConnected = false;
     };

     _SocketIO.onReconnect=^(NSInteger i)
     {
         NSLog(@"reconn");
         ISConnected = true;
     };

     _SocketIO.onReconnectionError=^(NSDictionary *dict)
     {
         NSLog(@"RERconnection error");
         ISConnected = false;
     };

 }];
0

There are 0 answers