node.js - Can't reconnect to socket.io without closing and reopening app -
i have ios app uses https://github.com/socketio/socket.io-client-swift connect socket.io server.
if open put app in background while in house connected wifi , walk out , down street out of range of wifi , open app lose connection. despite app attempting reconnect repeatedly, won't reconnect. i've verified trying reconnect using breakpoints. shutting app , restarting connect. however, if turn off wifi app in background stays connected (switches cellular i'm assuming). if turn on airplane mode , turn off again reconnects.
the same code called whether connect @ startup or reconnect. here pertinent code:
if( socketioswift != nil ) { [socketioswift disconnect]; [socketioswift removeallhandlers]; socketioswift = nil; } socketioswift = [[socketioclient alloc] initwithsocketurl:url config:@{@"secure": @yes, @"log": @yes, @"forcewebsockets": @yes, @"cookies": cookies, @"forcenew": @yes, @"reconnectattempts": @50, @"connectparams": properties}];
i've been thinking client, i'm wondering if socket.io.
any ideas?
Comments
Post a Comment