Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

killConnections does not work as specified on iOS #663

vjrantal opened this issue Mar 23, 2016 · 2 comments

killConnections does not work as specified on iOS #663

vjrantal opened this issue Mar 23, 2016 · 2 comments


Copy link

vjrantal commented Mar 23, 2016

The specification has killConnections documented like this:

 * # WARNING: This method is intended for internal Thali testing only. DO NOT
 * USE!
 * This method is only intended for iOS. It's job is to terminate all incoming
 * and outgoing multipeer connectivity framework browser, advertiser, MCSession
 * and stream connections immediately without using the normal stop and start
 * interfaces or TCP/IP level connections. The goal is to simulate what would
 * happen if we switched the phone to something like airplane mode. This
 * simulates what would happen if peers went out of range.
 * This method MUST return "Not Supported" if called on Android. On Android we
 * can get this functionality by using JXCore's ability to disable the local
 * radios.
 * | Error String | Description |
 * |--------------|-------------|
 * | Failed | Somehow the stop method couldn't do its job. Check the logs. |
 * | Not Supported | This method is not support on this platform. |
 * @private
 * @returns {Promise<?Error>}

However, on iOS, the implementation expects a peerIdentifier to be passed whereas the specification expects that all connections are killed.

Related to this, I renamed the function from killConnection to killConnections just so that there is a decent behavior when the function is called from the node layer.

@vjrantal vjrantal changed the title killConnections does not work as specifies on iOS killConnections does not work as specified on iOS Mar 23, 2016
Copy link
Member Author

This can be reproduce with the unit test app and looks like this in the log:

,# 51. make sure we actually call kill connections properly
,2016-03-23 11:52:56.788 ThaliTest[2011:3475110] jxcore: killConnections
2016-03-23 11:52:56.789 ThaliTest[2011:3475110] jxcore: killConnections: badParam
,not ok 190 should not fail on iOS
,    operator: fail
,  ...
,# teardown
,# setup

The badParam is expected because we don't pass a peer identifier to the call.

Copy link

yaronyg commented Aug 3, 2016

@baydet I'm assigning this to you to make sure we don't repeat the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

4 participants