{"action":"created","comment":{"url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/comments/236859566","pull_request_review_id":179014982,"id":236859566,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjg1OTU2Ng==","diff_hunk":"@@ -0,0 +1,62 @@\n+# Secondary Transport Optimization\n+\n+* Proposal: [SDL-NNNN](nnnn-secondary-transport-optimization.md)\n+* Author: [Joey Grover](https://github.com/joeygrover)\n+* Status: **Awaiting Review**\n+* Impacted Platforms: [Core / iOS / Android]\n+\n+## Introduction\n+\n+This proposal aims to optimize how secondary transports are connected and registered. The original proposal [SDL-0141](0141-multiple-transports.md) stated secondary transports should be connected to and registered on immediately when they are available. This proposal is to change that to connect and register on when necessary by the application.\n+\n+## Motivation\n+\n+The initial design had an oversight on transports optimization that would cause unnecessary battery drain and resource usage on the user's device. This is because an app would be required to connect a secondary transport like TCP immediately when the head unit sent a message that it was ready. In practical terms this was right after the app registered and was still in the HMI_NONE state. This meant, the app would create a TCP connection every time the user connected their phone via SDL even without any intention of using the app that connected the extra transport. This becomes increasingly irresponsible of the library when taking the example of a user that gets in and out of the vehicle multiple times over a short time span where each session a new TCP connection is established, maintained, and eventually torn down. The SDL library should not use resources that it doesn't fully intended on using. \n+\n+## Proposed solution\n+\n+The SDL library should only start a connection when the app intends to use it. This would reduce the unnecessary resource usage and improve battery usage of apps that implement the SDL library. The new flow should be as follows:\n+\n+1. App connects primary transport to Core\n+2. App sends `StartService` for an RPC service\n+3. If accepted, Core responds with a `StartServiceACK` that contains the potentially available secondary transports and which transports can be used for the audio and video service.\n+4. App starts the regular RPC service handshake and flow\n+5. During or after step 4, Core sends a `TransportEventUpdate` packet that contains the IP and port of a listening TCP connection in which the app can connect. The app caches this data.\n+6. App follows either Path A or B\n+\n+#### Path A: App requires the secondary transport\n+\n+1. App wishes to start either the video or audio service and Core has indicated that they are preferred to be started on the secondary transport.\n+2. App checks current connected transports: \n+     - If a suitable transport is connected the app will move to the next step\n+     - If no suitable transport is connected: \n+         1. The app will retrieve the previously cached IP and port of the module's listening TCP transport. \n+         2. The app will attempt to request a TCP connection be established.\n+         3. Once a connection is made, the app will move to the next step \n+3. The app sends a `RegisterSecondaryTransport` to Core over the connected secondary transport\n+4. If successful, Core responds with a `RegisterSecondaryTransportACK` on the same transport\n+5. The app then sends a `StartService` packet with the service type they wanted to start and the process resumes the standard flow\n+\n+\n+#### Path B: App does not require the secondary transport or the app is never moved past `HMI_NONE`\n+\n+1. The app will continue to work in the normal flow\n+2. If the app never needs to start a service that requires a secondary transport connection, the app will never request one becomes established.","path":"proposals/nnnn-secondary-transport-optimization.md","position":44,"original_position":44,"commit_id":"d717de281b1b6f4b20a75ce54e8ad10de5966c4b","original_commit_id":"d717de281b1b6f4b20a75ce54e8ad10de5966c4b","user":{"login":"jordynmackool","id":42153846,"node_id":"MDQ6VXNlcjQyMTUzODQ2","avatar_url":"https://avatars1.githubusercontent.com/u/42153846?v=4","gravatar_id":"","url":"https://api.github.com/users/jordynmackool","html_url":"https://github.com/jordynmackool","followers_url":"https://api.github.com/users/jordynmackool/followers","following_url":"https://api.github.com/users/jordynmackool/following{/other_user}","gists_url":"https://api.github.com/users/jordynmackool/gists{/gist_id}","starred_url":"https://api.github.com/users/jordynmackool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordynmackool/subscriptions","organizations_url":"https://api.github.com/users/jordynmackool/orgs","repos_url":"https://api.github.com/users/jordynmackool/repos","events_url":"https://api.github.com/users/jordynmackool/events{/privacy}","received_events_url":"https://api.github.com/users/jordynmackool/received_events","type":"User","site_admin":false},"body":"Change to:\r\n2. If the app never needs to start a service that requires a secondary transport connection, the app will never request one to become established.","created_at":"2018-11-27T21:47:25Z","updated_at":"2018-11-27T21:48:19Z","html_url":"https://github.com/smartdevicelink/sdl_evolution/pull/628#discussion_r236859566","pull_request_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/comments/236859566"},"html":{"href":"https://github.com/smartdevicelink/sdl_evolution/pull/628#discussion_r236859566"},"pull_request":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628"}}},"pull_request":{"url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628","id":234021805,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0MDIxODA1","html_url":"https://github.com/smartdevicelink/sdl_evolution/pull/628","diff_url":"https://github.com/smartdevicelink/sdl_evolution/pull/628.diff","patch_url":"https://github.com/smartdevicelink/sdl_evolution/pull/628.patch","issue_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues/628","number":628,"state":"open","locked":false,"title":"Secondary Transport Optimization","user":{"login":"joeygrover","id":6579474,"node_id":"MDQ6VXNlcjY1Nzk0NzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6579474?v=4","gravatar_id":"","url":"https://api.github.com/users/joeygrover","html_url":"https://github.com/joeygrover","followers_url":"https://api.github.com/users/joeygrover/followers","following_url":"https://api.github.com/users/joeygrover/following{/other_user}","gists_url":"https://api.github.com/users/joeygrover/gists{/gist_id}","starred_url":"https://api.github.com/users/joeygrover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeygrover/subscriptions","organizations_url":"https://api.github.com/users/joeygrover/orgs","repos_url":"https://api.github.com/users/joeygrover/repos","events_url":"https://api.github.com/users/joeygrover/events{/privacy}","received_events_url":"https://api.github.com/users/joeygrover/received_events","type":"User","site_admin":false},"body":"This proposal aims to optimize how secondary transports are connected and registered. The original proposal [SDL-0141](0141-multiple-transports.md) stated secondary transports should be connected to and registered on immediately when they are available. This proposal is to change that to connect and register on when necessary by the application.","created_at":"2018-11-27T18:50:53Z","updated_at":"2018-11-27T21:48:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a0b481a1609337bc90a08dee039539cfa12730f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628/commits","review_comments_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628/comments","review_comment_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues/628/comments","statuses_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/statuses/d717de281b1b6f4b20a75ce54e8ad10de5966c4b","head":{"label":"joeygrover:restructure_secondary_transport_flow","ref":"restructure_secondary_transport_flow","sha":"d717de281b1b6f4b20a75ce54e8ad10de5966c4b","user":{"login":"joeygrover","id":6579474,"node_id":"MDQ6VXNlcjY1Nzk0NzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6579474?v=4","gravatar_id":"","url":"https://api.github.com/users/joeygrover","html_url":"https://github.com/joeygrover","followers_url":"https://api.github.com/users/joeygrover/followers","following_url":"https://api.github.com/users/joeygrover/following{/other_user}","gists_url":"https://api.github.com/users/joeygrover/gists{/gist_id}","starred_url":"https://api.github.com/users/joeygrover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeygrover/subscriptions","organizations_url":"https://api.github.com/users/joeygrover/orgs","repos_url":"https://api.github.com/users/joeygrover/repos","events_url":"https://api.github.com/users/joeygrover/events{/privacy}","received_events_url":"https://api.github.com/users/joeygrover/received_events","type":"User","site_admin":false},"repo":{"id":64487476,"node_id":"MDEwOlJlcG9zaXRvcnk2NDQ4NzQ3Ng==","name":"sdl_evolution","full_name":"joeygrover/sdl_evolution","private":false,"owner":{"login":"joeygrover","id":6579474,"node_id":"MDQ6VXNlcjY1Nzk0NzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6579474?v=4","gravatar_id":"","url":"https://api.github.com/users/joeygrover","html_url":"https://github.com/joeygrover","followers_url":"https://api.github.com/users/joeygrover/followers","following_url":"https://api.github.com/users/joeygrover/following{/other_user}","gists_url":"https://api.github.com/users/joeygrover/gists{/gist_id}","starred_url":"https://api.github.com/users/joeygrover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeygrover/subscriptions","organizations_url":"https://api.github.com/users/joeygrover/orgs","repos_url":"https://api.github.com/users/joeygrover/repos","events_url":"https://api.github.com/users/joeygrover/events{/privacy}","received_events_url":"https://api.github.com/users/joeygrover/received_events","type":"User","site_admin":false},"html_url":"https://github.com/joeygrover/sdl_evolution","description":"Tracking and proposing changes to SDL's public APIs.","fork":true,"url":"https://api.github.com/repos/joeygrover/sdl_evolution","forks_url":"https://api.github.com/repos/joeygrover/sdl_evolution/forks","keys_url":"https://api.github.com/repos/joeygrover/sdl_evolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joeygrover/sdl_evolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joeygrover/sdl_evolution/teams","hooks_url":"https://api.github.com/repos/joeygrover/sdl_evolution/hooks","issue_events_url":"https://api.github.com/repos/joeygrover/sdl_evolution/issues/events{/number}","events_url":"https://api.github.com/repos/joeygrover/sdl_evolution/events","assignees_url":"https://api.github.com/repos/joeygrover/sdl_evolution/assignees{/user}","branches_url":"https://api.github.com/repos/joeygrover/sdl_evolution/branches{/branch}","tags_url":"https://api.github.com/repos/joeygrover/sdl_evolution/tags","blobs_url":"https://api.github.com/repos/joeygrover/sdl_evolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joeygrover/sdl_evolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joeygrover/sdl_evolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/joeygrover/sdl_evolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joeygrover/sdl_evolution/statuses/{sha}","languages_url":"https://api.github.com/repos/joeygrover/sdl_evolution/languages","stargazers_url":"https://api.github.com/repos/joeygrover/sdl_evolution/stargazers","contributors_url":"https://api.github.com/repos/joeygrover/sdl_evolution/contributors","subscribers_url":"https://api.github.com/repos/joeygrover/sdl_evolution/subscribers","subscription_url":"https://api.github.com/repos/joeygrover/sdl_evolution/subscription","commits_url":"https://api.github.com/repos/joeygrover/sdl_evolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/joeygrover/sdl_evolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/joeygrover/sdl_evolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/joeygrover/sdl_evolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/joeygrover/sdl_evolution/contents/{+path}","compare_url":"https://api.github.com/repos/joeygrover/sdl_evolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joeygrover/sdl_evolution/merges","archive_url":"https://api.github.com/repos/joeygrover/sdl_evolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joeygrover/sdl_evolution/downloads","issues_url":"https://api.github.com/repos/joeygrover/sdl_evolution/issues{/number}","pulls_url":"https://api.github.com/repos/joeygrover/sdl_evolution/pulls{/number}","milestones_url":"https://api.github.com/repos/joeygrover/sdl_evolution/milestones{/number}","notifications_url":"https://api.github.com/repos/joeygrover/sdl_evolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joeygrover/sdl_evolution/labels{/name}","releases_url":"https://api.github.com/repos/joeygrover/sdl_evolution/releases{/id}","deployments_url":"https://api.github.com/repos/joeygrover/sdl_evolution/deployments","created_at":"2016-07-29T14:37:52Z","updated_at":"2018-11-27T16:38:13Z","pushed_at":"2018-11-27T18:50:17Z","git_url":"git://github.com/joeygrover/sdl_evolution.git","ssh_url":"git@github.com:joeygrover/sdl_evolution.git","clone_url":"https://github.com/joeygrover/sdl_evolution.git","svn_url":"https://github.com/joeygrover/sdl_evolution","homepage":"www.smartdevicelink.com","size":10335,"stargazers_count":0,"watchers_count":0,"language":"XSLT","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"smartdevicelink:master","ref":"master","sha":"f9ac24f0e3799b8dea605e0bc01ac8c26079171a","user":{"login":"smartdevicelink","id":8671397,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2NzEzOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8671397?v=4","gravatar_id":"","url":"https://api.github.com/users/smartdevicelink","html_url":"https://github.com/smartdevicelink","followers_url":"https://api.github.com/users/smartdevicelink/followers","following_url":"https://api.github.com/users/smartdevicelink/following{/other_user}","gists_url":"https://api.github.com/users/smartdevicelink/gists{/gist_id}","starred_url":"https://api.github.com/users/smartdevicelink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartdevicelink/subscriptions","organizations_url":"https://api.github.com/users/smartdevicelink/orgs","repos_url":"https://api.github.com/users/smartdevicelink/repos","events_url":"https://api.github.com/users/smartdevicelink/events{/privacy}","received_events_url":"https://api.github.com/users/smartdevicelink/received_events","type":"Organization","site_admin":false},"repo":{"id":63362559,"node_id":"MDEwOlJlcG9zaXRvcnk2MzM2MjU1OQ==","name":"sdl_evolution","full_name":"smartdevicelink/sdl_evolution","private":false,"owner":{"login":"smartdevicelink","id":8671397,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2NzEzOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8671397?v=4","gravatar_id":"","url":"https://api.github.com/users/smartdevicelink","html_url":"https://github.com/smartdevicelink","followers_url":"https://api.github.com/users/smartdevicelink/followers","following_url":"https://api.github.com/users/smartdevicelink/following{/other_user}","gists_url":"https://api.github.com/users/smartdevicelink/gists{/gist_id}","starred_url":"https://api.github.com/users/smartdevicelink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartdevicelink/subscriptions","organizations_url":"https://api.github.com/users/smartdevicelink/orgs","repos_url":"https://api.github.com/users/smartdevicelink/repos","events_url":"https://api.github.com/users/smartdevicelink/events{/privacy}","received_events_url":"https://api.github.com/users/smartdevicelink/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/smartdevicelink/sdl_evolution","description":"Tracking and proposing changes to SDL's public APIs.","fork":false,"url":"https://api.github.com/repos/smartdevicelink/sdl_evolution","forks_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/forks","keys_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/teams","hooks_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/hooks","issue_events_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues/events{/number}","events_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/events","assignees_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/assignees{/user}","branches_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/branches{/branch}","tags_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/tags","blobs_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/statuses/{sha}","languages_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/languages","stargazers_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/stargazers","contributors_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/contributors","subscribers_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/subscribers","subscription_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/subscription","commits_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/contents/{+path}","compare_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/merges","archive_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/downloads","issues_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues{/number}","pulls_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls{/number}","milestones_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/milestones{/number}","notifications_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/labels{/name}","releases_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/releases{/id}","deployments_url":"https://api.github.com/repos/smartdevicelink/sdl_evolution/deployments","created_at":"2016-07-14T19:08:19Z","updated_at":"2018-11-21T19:10:21Z","pushed_at":"2018-11-27T18:57:21Z","git_url":"git://github.com/smartdevicelink/sdl_evolution.git","ssh_url":"git@github.com:smartdevicelink/sdl_evolution.git","clone_url":"https://github.com/smartdevicelink/sdl_evolution.git","svn_url":"https://github.com/smartdevicelink/sdl_evolution","homepage":"https://smartdevicelink.github.io/sdl_evolution/","size":10307,"stargazers_count":22,"watchers_count":22,"language":"XSLT","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":84,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":84,"open_issues":20,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628"},"html":{"href":"https://github.com/smartdevicelink/sdl_evolution/pull/628"},"issue":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues/628"},"comments":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/issues/628/comments"},"review_comments":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628/comments"},"review_comment":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/pulls/628/commits"},"statuses":{"href":"https://api.github.com/repos/smartdevicelink/sdl_evolution/statuses/d717de281b1b6f4b20a75ce54e8ad10de5966c4b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jordynmackool"}}