In advance, I appreciate your time spent helping on this.
My iOS app is set up using CB Lite, reflecting the iOS ToDo replication example as best I can. I have the Sync Gateway implemented, along with a shadowing bucket on CB Server. I also have a server-side application that is set up to write new documents to the CB Server on demand. Here is the iOS code to start replication:
// Initialize Couchbase Replication
_push = database.createPushReplication(SyncGatewayURL)
_pull = database.createPullReplication(SyncGatewayURL)
_push.continuous = true
_pull.continuous = true
When I start up the iOS app, everything works really well. My server-side app writes to CB Server, and the changes are pushed to the iOS client. After several minutes though, the logging on the SG it appears to note that it closes the Socket to the iOS client with the following note:
10:28:30.957125 HTTP+: #265: --> WebSocket closed
At this point, the iOS client also logs that it has disconnected, then immediately attempts to reconnect:
2015-03-31 10:28:31.166 appName[648:1822315] CBLWebSocketChangeTracker[0x17d40c80 sync_gateway]: Connection error #1, retrying in 2.0 sec: Socket closed by remote peer
2015-03-31 10:28:33.168 appName[648:1822315] SyncVerbose: CBLWebSocketChangeTracker[0x17d40c80 sync_gateway]: GET //172.23.7.190:4984/sync_gateway/_changes?feed=websocket
At this point, however, the application never again updates the data in the app. No new logs are written unless the database changes on the iOS side and new changes are pushed. Even when the CB Server application writes new updates, the SG see’s them and “notifies” everyone, but the iOS client never see’s any updates thereafter.
Again, thank you for your help! Please let me know if additional details would be helpful.