diff --git a/.gitignore b/.gitignore index 27a7afb52..19797d37d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ log/ *.swp *.so examples +docs/build/* diff --git a/docs/source/_images/emqttd.graphml b/docs/source/_images/emqttd.graphml new file mode 100644 index 000000000..0add31baf --- /dev/null +++ b/docs/source/_images/emqttd.graphml @@ -0,0 +1,993 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + emqttd broker cluster + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + Client + + + + + + + + + + + + + + + + + Sensor + + + + + + + + + + + + + + + + + Sensor + + + + + + + + + + + + + + + + + Client + + + + + + + + + + + + + + + + + + Application Server + + + + + + + + + + + + + + + + + + Web + + + + + + + + + + + + + + + + + + Web + + + + + + + + + + + + + + + + + + iPhone + + + + + + + + + + + + + + + + + + Android + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MQTT + + + + + + + + + + + + + + + + + + + HTTP + + + + + + + + + + + + + + + + + + + MQTT + + + + + + + + + + + + + + + + + + + WebSocket + + + + + + + + + + + + + + + + + + + WebSocket + + + + + + + + + + + + + + + + + + + MQTT + + + + + + + + + + + + + + + + + + + MQTT + + + + + + + + + + + + + + + + + + + MQTT + + + + + + + + + + + + + + + + diff --git a/docs/source/_images/emqttd2.png b/docs/source/_images/emqttd2.png new file mode 100644 index 000000000..6066d5d08 Binary files /dev/null and b/docs/source/_images/emqttd2.png differ diff --git a/docs/source/design/ClientSession.md b/docs/source/design/ClientSession.md new file mode 100644 index 000000000..c7f6f53d2 --- /dev/null +++ b/docs/source/design/ClientSession.md @@ -0,0 +1,55 @@ +## Transient Client/Session Sequence1 + +``` +Client1->SM: {start_session, {true, ClientId, self()}} +SM-->Session: {destory, ClientId} +Session-->Session: {shutdown, destroy} +Session-->Client2: exit({shutdown, destroy}) +Client2-->CM: {'DOWN', MRef, process, Pid, Reason} +SM-->Client1: {ok, SessPid} +Client1-->CM: {register, Client1} +``` + +![Transient Client/Session Sequence1](TransientSessionSeq1.png) + +## Transient Client/Session Sequence2 + + +``` +Client1->SM: {start_session, {true, ClientId, self()}} +SM-->Session: {destory, ClientId} +Session-->Session: {shutdown, destroy} +SM-->Client1: {ok, SessPid} +Client1-->CM: {register, Client1} +Session-->Client2: exit({shutdown, destroy}) +Client2-->CM: {'DOWN', MRef, process, Pid, Reason} +``` + +![Transient Client/Session Sequence2](TransientSessionSeq2.png) + +## Persistent Client/Session Sequence1 + +``` +Client1->SM: {start_session, {true, ClientId, self()}} +SM-->Session: {resume, ClientId, ClientPid} +Session-->Client2: {shutdown, conflict, {ClientId, Pid}} +Client2-->CM: {unregister, ClientId, self()} +SM-->Client1: {ok, SessPid} +Client1-->CM: {register, Client1} +``` + +![Persistent Client/Session Sequence1](PersistentSessionSeq1.png) + + +## Persistent Client/Session Sequence2 + +``` +Client1->SM: {start_session, {true, ClientId, self()}} +SM-->Session: {resume, ClientId, ClientPid} +SM-->Client1: {ok, SessPid} +Client1-->CM: {register, Client1} +Session-->Client2: {shutdown, conflict, {ClientId, Pid}} +Client2-->CM: {unregister, ClientId, self()} +``` + +![Persistent Client/Session Sequence2](PersistentSessionSeq2.png) diff --git a/docs/source/design/Design_Cluster.graphml b/docs/source/design/Design_Cluster.graphml new file mode 100644 index 000000000..0e1e06791 --- /dev/null +++ b/docs/source/design/Design_Cluster.graphml @@ -0,0 +1,847 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + emqttd cluster + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + P + + + + + + + + + + + + + + + + + + P + + + + + + + + + + + + + + + + + + S + + + + + + + + + + + + + + + + + + S + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/design/Design_Standalone.graphml b/docs/source/design/Design_Standalone.graphml new file mode 100644 index 000000000..9382a66f6 --- /dev/null +++ b/docs/source/design/Design_Standalone.graphml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + P + + + + + + + + + + + + + + + + + + P + + + + + + + + + + + + + + + + + + S + + + + + + + + + + + + + + + + + + S + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + + + + + + + + + + + + + + + + + y + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/design/route.rst b/docs/source/design/route.rst index 68f8cb7db..89882c23f 100644 --- a/docs/source/design/route.rst +++ b/docs/source/design/route.rst @@ -2,3 +2,10 @@ Route ===== +Topic Trie + +Topic -> Node1, Node2, Node3, ... + +Topic -> Pid1, Pid2, Pid3, ... + + diff --git a/docs/source/mqtt/mqtt-v3.1.1-os.pdf b/docs/source/mqtt/mqtt-v3.1.1-os.pdf new file mode 100644 index 000000000..03a935fdd Binary files /dev/null and b/docs/source/mqtt/mqtt-v3.1.1-os.pdf differ