Skip to content

fix: add timeout when awaiting notification response #57

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

Merged
merged 4 commits into from
Aug 28, 2019

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Aug 27, 2019

All socket connections were changed and now are started in ssl mode. This changes the way messages are sent and received from sockets. As a result, timeout option is not anymore respected when receiving messages from socket. However, the messages now are received only via methods from mobile device lib. As there isn't a built-in method in mobile device that can work with timeout, we implemented timeout mechanism using threads. The await_notification_response operation is started in separate thread and after the provided timeout, the started thread is terminated.

Rel to NativeScript/nativescript-cli#4966

@Fatme Fatme changed the title Fatme/await notification fix: add timeout when awaiting notification response Aug 27, 2019
Fatme added 2 commits August 28, 2019 16:01
All socket connections were changed and now are started in ssl mode. This changes the way messages are sent and received from sockets. As a result, `timeout` option is not anymore respected when receiving messages from socket. However, the messages now are received only via methods from mobile device lib. As there isn't a built-in method in mobile device that can work with timeout, we implemented timeout mechanism using new thread. `AMDServiceConnectionReceive` blocks the current thread when application is not running on device. After the provided timeout, the socket connection is invalidated and this way the current thread is freed.
@Fatme Fatme force-pushed the fatme/await-notification branch from fa701c8 to df52dfe Compare August 28, 2019 13:20
@Fatme Fatme merged commit 1110296 into master Aug 28, 2019
@Fatme Fatme deleted the fatme/await-notification branch August 28, 2019 14:10
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.

2 participants