-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Reconnect sockets on iOS when resuming from background #292
base: master
Are you sure you want to change the base?
Conversation
This allows playback to be restarted, and GCDWebServer doesn't have to be reinitialized.
It sounds like expected behavior on iOS: did you see README section on background? I think it's the same as locking iPad. |
There appear to be subtle differences between locking the device and simply backgrounding the app. We do not experience any issues when backgrounding the app. However, when locking the device, you can get the sockets that GCDWebServer uses into an error state. This only happens in two specific conditions.
In both cases GCDWebServer is required to be stopped and restarted by the user before any requests will be processed. This pull request automatically resets the sockets so that the server can be used normally. |
Any thoughts on this @swisspol? We can always fork and make the changes there if you're thinking these are too particular of use cases. We simply thought it would only be beneficial to the larger community to have these. |
This is an important change I need to think about. Unfortunately, I do not have the bandwidth to look at it these days - very busy on other projects... |
Ok, I think for now we are going to fork it and apply the changes. If you do end up pulling this in just let me know so we can come back. Thanks for the great repo! |
@EricJones89 We are also experiencing this bug, but haven't tried the patch yet. Will report back tomorrow. @swisspol If you're swamped, would you be open to adding some volunteers? I maintain a few other libraries and could chip in occasionally. |
@chrisballinger Between work and family I have indeed close to zero time for GitHub open source projects these days, so helped would be welcome. I have to be honest though the code quality bar is high in this project and it's quite popular so any change needs to be considered very carefully. |
@swisspol I maintain a few popular libraries like CocoaAsyncSocket, XMPPFramework, and KissXML and have worked with contributors to improve their PRs to maintain code quality and increase test coverage. I have limited time myself, so for GCDWebServer I would only have bandwidth to focus on merging small bug fixes and would still need to defer larger changes to you. Perhaps there are other high profile users of this library that would be able to volunteer? |
@chrisballinger Sounds great! Thanks much for volunteering. I just added you as a collaborator. Would I would prefer that you create a "chris" branch or equivalent, merge PRs into it and then I can have a look at that branch and give final greenlight after a couple weeks or something. |
We're having this same issue.
I tried this pull request and it did not solve our problems. I'll post here if I find anything else. |
So maybe I don't have the same problem just the same symptoms. We had |
I can also reproduce this with a meteor-app which uses GCDWebServer: meteor/meteor#8763 see reproduction 2 Edit: I will try to apply this fix to see whether it solves our issue edit2: it solves our issues as well |
Any news on the Meteor fork changes being included into this? The version Meteor is using is two years old and I can't tell whether the fixes there got into here. Thanks! |
This fixes a bug which prevented resuming of playback when an iPad is locked during the playing of a video. When the iPad was subsequently unlocked the video would not resume playing even when the play button was tapped.
This fix restarts any sockets that had been in use without having to reinitialize the GCDWebServer.