{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments/146396612","pull_request_review_id":71332924,"id":146396612,"diff_hunk":"@@ -0,0 +1,81 @@\n+# transport_state_machine Requirements\n+\n+## Overview\n+This module provides HTTP protocol support to communicate with the Azure device provisioning service\n+\n+## Example Usage\n+``js\n+  // this is effectively an abstract class that transport implements are built upon.  It is not meant to be used directly.\n+``\n+\n+## Public Interface\n+\n+### constructor()\n+The constructor creates a TransportStateMachine object\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_001: [** The `constructor` shall accept no arguments **]**\n+\n+\n+### connect(callback: (err?: Error) => void): void\n+Connect is used to connect the transport\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_002: [** `connect` shall call `_doConnectForFsm`. **]**\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_003: [** If `_doConnectForFsm` fails, then `connect` shall fail. **]**\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_004: [** If the transport is already connected, then `connect` shall do nothing and call the `callback` immediately. **]**\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_005: [** If `connect` is called while a connection is in progress, it shall wait for that connection to complete before calling `callback`. **]**\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_006: [** If `connect` is called while the transport is executing the first registration request, it shall do nothing and call `callback` immediately. **]**\n+\n+**SRS_NODE_PROVISIONING_TRANSPORT_STATE_MACHINE_18_007: [** If `connect` is called while the transport is waiting between operation status queries, it shall do nothing and call `callback` immediately. **]**","path":"provisioning/device/devdoc/transport_state_machine_requirements.md","position":32,"original_position":32,"commit_id":"17dd1dbe9188d1783b6ea637b74a6676db6254e2","original_commit_id":"17dd1dbe9188d1783b6ea637b74a6676db6254e2","user":{"login":"pierreca","id":4979572,"avatar_url":"https://avatars2.githubusercontent.com/u/4979572?v=4","gravatar_id":"","url":"https://api.github.com/users/pierreca","html_url":"https://github.com/pierreca","followers_url":"https://api.github.com/users/pierreca/followers","following_url":"https://api.github.com/users/pierreca/following{/other_user}","gists_url":"https://api.github.com/users/pierreca/gists{/gist_id}","starred_url":"https://api.github.com/users/pierreca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierreca/subscriptions","organizations_url":"https://api.github.com/users/pierreca/orgs","repos_url":"https://api.github.com/users/pierreca/repos","events_url":"https://api.github.com/users/pierreca/events{/privacy}","received_events_url":"https://api.github.com/users/pierreca/received_events","type":"User","site_admin":false},"body":"not possible to disconnect and reconnect between operation status queries?","created_at":"2017-10-23T21:17:12Z","updated_at":"2017-10-23T21:17:12Z","html_url":"https://github.com/Azure/azure-iot-sdk-node/pull/115#discussion_r146396612","pull_request_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments/146396612"},"html":{"href":"https://github.com/Azure/azure-iot-sdk-node/pull/115#discussion_r146396612"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115","id":147904540,"html_url":"https://github.com/Azure/azure-iot-sdk-node/pull/115","diff_url":"https://github.com/Azure/azure-iot-sdk-node/pull/115.diff","patch_url":"https://github.com/Azure/azure-iot-sdk-node/pull/115.patch","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/115","number":115,"state":"open","locked":false,"title":"transport agnostic state machine for DPS","user":{"login":"BertKleewein","id":8028738,"avatar_url":"https://avatars0.githubusercontent.com/u/8028738?v=4","gravatar_id":"","url":"https://api.github.com/users/BertKleewein","html_url":"https://github.com/BertKleewein","followers_url":"https://api.github.com/users/BertKleewein/followers","following_url":"https://api.github.com/users/BertKleewein/following{/other_user}","gists_url":"https://api.github.com/users/BertKleewein/gists{/gist_id}","starred_url":"https://api.github.com/users/BertKleewein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BertKleewein/subscriptions","organizations_url":"https://api.github.com/users/BertKleewein/orgs","repos_url":"https://api.github.com/users/BertKleewein/repos","events_url":"https://api.github.com/users/BertKleewein/events{/privacy}","received_events_url":"https://api.github.com/users/BertKleewein/received_events","type":"User","site_admin":false},"body":"# Description of the problem]\r\n\r\nWhile working on the MQTT protocol, I discovered that MQTT, HTTP, and, I presume, AMQP have a ton in common, both in terms of how the protocols operate, but also in terms of the state machine I need to use.  (For example, MQTT registration queries for operation status instead of using a C2D topic to send status updates.  In other words, we have to poll with MQTT just like we poll with HTTP.)\r\n\r\nWhile writing the MQTT state machine, I discovered that I was copying a bunch of code from the HTTP state machine.  Rather than copy/paste, I decided to refactor the state machine out of the transport implementation.  TransportStateMachine is effectively an abstract base class for all the transports.  It has the state machine and all the transport-specific operations are left to the derived object to implement.\r\n","created_at":"2017-10-20T22:03:40Z","updated_at":"2017-10-23T21:17:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d983271209584e55fe27c1c7d727a4be73dbc33","assignee":null,"assignees":[],"requested_reviewers":[{"login":"anthonyvercolano","id":9854568,"avatar_url":"https://avatars0.githubusercontent.com/u/9854568?v=4","gravatar_id":"","url":"https://api.github.com/users/anthonyvercolano","html_url":"https://github.com/anthonyvercolano","followers_url":"https://api.github.com/users/anthonyvercolano/followers","following_url":"https://api.github.com/users/anthonyvercolano/following{/other_user}","gists_url":"https://api.github.com/users/anthonyvercolano/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonyvercolano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonyvercolano/subscriptions","organizations_url":"https://api.github.com/users/anthonyvercolano/orgs","repos_url":"https://api.github.com/users/anthonyvercolano/repos","events_url":"https://api.github.com/users/anthonyvercolano/events{/privacy}","received_events_url":"https://api.github.com/users/anthonyvercolano/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/115/comments","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/17dd1dbe9188d1783b6ea637b74a6676db6254e2","head":{"label":"Azure:bertk-mqtt","ref":"bertk-mqtt","sha":"17dd1dbe9188d1783b6ea637b74a6676db6254e2","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":70935002,"name":"azure-iot-sdk-node","full_name":"Azure/azure-iot-sdk-node","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-iot-sdk-node","description":"A Node.js SDK for connecting devices to Microsoft Azure IoT services","fork":false,"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node","forks_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/forks","keys_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/teams","hooks_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/events","assignees_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/tags","blobs_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/subscription","commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/merges","archive_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/downloads","issues_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/deployments","created_at":"2016-10-14T18:03:43Z","updated_at":"2017-10-21T15:20:03Z","pushed_at":"2017-10-23T20:42:27Z","git_url":"git://github.com/Azure/azure-iot-sdk-node.git","ssh_url":"git@github.com:Azure/azure-iot-sdk-node.git","clone_url":"https://github.com/Azure/azure-iot-sdk-node.git","svn_url":"https://github.com/Azure/azure-iot-sdk-node","homepage":"https://docs.microsoft.com/en-us/azure/iot-hub/","size":42592,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":21,"forks":51,"open_issues":21,"watchers":61,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"ff0f3f2ef608e4be3909d1c4f81f788ebc351323","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":70935002,"name":"azure-iot-sdk-node","full_name":"Azure/azure-iot-sdk-node","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-iot-sdk-node","description":"A Node.js SDK for connecting devices to Microsoft Azure IoT services","fork":false,"url":"https://api.github.com/repos/Azure/azure-iot-sdk-node","forks_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/forks","keys_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/teams","hooks_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/events","assignees_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/tags","blobs_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/subscription","commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/merges","archive_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/downloads","issues_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-node/deployments","created_at":"2016-10-14T18:03:43Z","updated_at":"2017-10-21T15:20:03Z","pushed_at":"2017-10-23T20:42:27Z","git_url":"git://github.com/Azure/azure-iot-sdk-node.git","ssh_url":"git@github.com:Azure/azure-iot-sdk-node.git","clone_url":"https://github.com/Azure/azure-iot-sdk-node.git","svn_url":"https://github.com/Azure/azure-iot-sdk-node","homepage":"https://docs.microsoft.com/en-us/azure/iot-hub/","size":42592,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":21,"forks":51,"open_issues":21,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115"},"html":{"href":"https://github.com/Azure/azure-iot-sdk-node/pull/115"},"issue":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/115"},"comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-iot-sdk-node/statuses/17dd1dbe9188d1783b6ea637b74a6676db6254e2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pierreca"}}