Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-connect peers after leaving app #3

Open
coopersita opened this issue Mar 1, 2015 · 4 comments
Open

Re-connect peers after leaving app #3

coopersita opened this issue Mar 1, 2015 · 4 comments

Comments

@coopersita
Copy link

I know this is probably an underlying issue with the MPC framework, but I was wondering if there is a way in which users that leave the game (check email, answer a text or phone call), and then come back can be re-connected.

@jpsim
Copy link
Owner

jpsim commented Mar 1, 2015

This definitely sounds like more of a bug in CardsAgainst rather than MPC. Feel free to file a PR if you can fix this.

@ryan2clw
Copy link

I was just looking at this issue with some code I found on the web. When the user logs off, and reopens, a new instance of the MPC is created and so essentially there's a memory leak because the old instance doesn't release automatically. Apple gives a workaround at 32:00 in this video:
https://developer.apple.com/videos/play/wwdc2014/709/. There might have been more on this in other videos too from wwdc2013.

Basically, if you persist the data like the PeerID using NSKeyedArchiver, you can have the app remember who it lost a connection to so that you're not constantly re-instantiating new MPC channels. Was going to eventually add this to some code I found by Ralph Ebert on MPCs.

@lgdelacruz92
Copy link

Hey @jpsim has this bug been fixed? I wanna take a crack at doing @ryan2clw recommendation

@jpsim
Copy link
Owner

jpsim commented Jan 19, 2018

I don't think anything's been done regarding this. If you can reproduce an issue, then you're in an ideal place to improve it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants