diff options
-rw-r--r-- | conn-notes.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/conn-notes.txt b/conn-notes.txt new file mode 100644 index 00000000..f4964829 --- /dev/null +++ b/conn-notes.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | Status of a tox friend netcrypto session. | ||
2 | ----------------------------------------- | ||
3 | data ToxProgress | ||
4 | = AwaitingDHTKey -- ^ Waiting to receive their DHT key. | ||
5 | | AcquiringIPAddress -- ^ Searching DHT to obtain their node's IP & port. | ||
6 | | AcquiringCookie -- ^ Attempting to obtain a cookie. | ||
7 | | AwaitingHandshake -- ^ Waiting to receive a handshake. | ||
8 | | AwaitingSessionPacket -- ^ Connection is "accepted" but not yet "confirmed". | ||
9 | deriving (Eq,Ord,Enum,Show) | ||
10 | |||
11 | |||
12 | Information about concat toxid and events that provide it. | ||
13 | ---------------------------------------------------------- | ||
14 | SockAddr | ||
15 | receive packet with dhtkey associated with toxid | ||
16 | receive query result with dhtkey associated with toxid | ||
17 | receive netcrypto session packet from toxid | ||
18 | DHTKey | ||
19 | receive dhtpk over DataToRoute transport. | ||
20 | receive dht message from SockAddr | ||
21 | receive dhtpk via dht-request | ||
22 | |||
23 | |||
24 | |||
25 | Recurring tasks associated with obtaining a connection. | ||
26 | ------------------------------------------------------- | ||
27 | while (account is active): | ||
28 | announce{toxid} | ||
29 | |||
30 | while (policy=TryingToConnect and friend session is not established) | ||
31 | search{toxid} contact, send my dhtkey to results | ||
32 | |||
33 | while (dhtkey is fresh but sockaddr is stale) | ||
34 | search{node} dhtkey | ||
35 | |||
36 | while (dhtkey and sockaddr are fresh) | ||
37 | send handshake | ||
38 | |||
39 | |||
40 | |||