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

Fix connection closed on pause #1

Closed
wants to merge 1 commit into from
Closed

Conversation

ksubileau
Copy link

Hi,

I suggest you add these two lines of code to avoid closing the ssh connection every time the application loses focus.

In my case, I used your application to test a Python code using the USB host mode API. The use of this API requires the permission of the user, so Android displays a dialog box to ask for it. And when this dialog box appears, the application is paused and this causes the connection reset.

@alanjds
Copy link
Contributor

alanjds commented Jan 7, 2014

Questions:

  1. This still freezes the shell if I click the Home button, right?

  2. Is possible to change it to a service-based version, so I could switch out and still do something on the terminal? (lets say, makeToast while in android Home screen ?)

@ksubileau
Copy link
Author

  1. Yes, the shell is frozen, but the connection is kept alive instead of being killed,
  2. Yes it would be ideal, but at first this quick fix avoids having to reconect all the time.

@alanjds
Copy link
Contributor

alanjds commented Jan 7, 2014

Agree. Just trying to save some work if you answer "1) No. it does not freeze anymore!"

:)

I was planning to create a service-based version before saw this PR

Guessing it the tornado-reactor would work on the service-based one...

@brousch
Copy link

brousch commented Jan 7, 2014

It already uses twisted, so it may make sense to stick with that.
On Jan 7, 2014 6:28 PM, "Alan Justino da Silva" [email protected]
wrote:

Agree. Just trying to save some work if you answer "1) No. it does not
freeze anymore!"

:)

I was planning to create a service-based version before saw this PR

Guessing it the tornado-reactor would work on the service-based one...


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-31791291
.

@alanjds
Copy link
Contributor

alanjds commented Jan 7, 2014

Oops. I meant tornado-reactor

@alanjds
Copy link
Contributor

alanjds commented Jan 11, 2014

Oops again. I meant twisted-reactor

@alanjds
Copy link
Contributor

alanjds commented Jan 11, 2014

Update: I managed to create a service-based version, but it does not runs the service if using the Launcher APK for now (see: kivy/python-for-android#192).

But it works if using own APK. Will test a bit more before issuing a PR here.

@alanjds
Copy link
Contributor

alanjds commented Jan 11, 2014

The service-based version is on #3. Anyway, I think this one (#1) should be accepted, as the service-based have no access to the mActivity :(

@alanjds
Copy link
Contributor

alanjds commented Aug 17, 2016

I am confused. This got merged or not?

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

Successfully merging this pull request may close these issues.

4 participants