session: Add session overview documentation
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 12 Apr 2011 06:53:35 +0000 (08:53 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 12 Apr 2011 13:27:43 +0000 (15:27 +0200)
doc/session-overview.txt [new file with mode: 0644]

diff --git a/doc/session-overview.txt b/doc/session-overview.txt
new file mode 100644 (file)
index 0000000..f07eca2
--- /dev/null
@@ -0,0 +1,71 @@
+Session API
+***********
+
+
+Connection management algorithm basics
+======================================
+
+When a session is created, a sorted list of services is added to the
+session. The services are filtered and stable sorted according
+following rules:
+
+ - AllowedBearers (filter and sort)
+ - RoamingPolicy (filter and sort)
+
+A stable sorting algorithms maintains the relative order.
+
+If a service is removed or added all sessions are updated according
+the above rules.
+
+There are three triggers which lead to evaluate the connect
+algorithm:
+
+ - Session.Connect()
+ - PeriodicConnect
+ - Offline
+
+Connect algorithm:
+
+              Session.Connect()     Offline
+              PeriodicConnect        |
+                       | Yes  +------+-------+  No
+                       +------+StayConnected?+------ Do nothing
+                       |      +--------------+
+                       |
+                       |
+                +------+-------+
+          +-----+EmergencyCall?+-----+
+       Yes|     +--------------+     |No
+          |                          |
+        Connect to            +--------------+
+        first available   +---+AvoidHandover?+---+
+        Service           |   +--------------+   |
+                       Yes|                      |No
+                 +----------------+              |
+             +---+In service_list +---+          |
+          Yes|   |and online?     |   |No        |
+             |   +----------------+   |          |
+             |                        |          |
+         Take that one                Take first in
+                                      the service list
+
+There are two triggers which lead to evaluate the disconnect
+algorithm
+
+ - Session.Disconnect()
+ - IdleTimeout
+
+Disconnect algorithm:
+
+  Session.Disconnect()
+  IdleTimeout
+       |
+       |
+       |
++-----------------+    Yes
+|service not used +-------------+
+|by other session?|             |
++------.----------+             |
+       |No                      |
+       |                        |
+    Service.Disconnect()   Do nothing