2.0.14 • Published 5 years ago

dop-transports v2.0.14

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

CONNECTIVITY PROTOCOL PROPOSAL

SERVER and CLIENT are both nodes instances in the dop world.

STATUS

OPEN: 0
PRECONNECTED: 1
CONNECTED: 2
RECONNECTING: 3
DISCONNECTED: 4

CONNECTION

  1. Connection opened via WebSockets and this is the state for both nodes:
SERVER
- status: OPEN
- token_local: AAAA
- socket: 1

CLIENT
- status: OPEN
- token_local: BBBB
- socket: 1
  1. Both sends the instruction to start the connection
  2. Client sends BBBB
  3. Server sends AAAA
SERVER
- status: PRECONNECTED
- token_local: AAAA
- token_remote: BBBB
- socket: 1

CLIENT
- status: PRECONNECTED
- token_local: BBBB
- token_remote: AAAA
- socket: 1
  1. Both sends the local token again to confirm the connection
  2. Server sends AAAA
  3. Client sends BBBB
  4. Both nodes merge the local and remote token to create the final token (The merge must be in alphabetical order)
SERVER
- status: CONNECTED
- token: AAAABBBB
- socket: 1

CLIENT
- status: CONNECTED
- token: AAAABBBB
- socket: 1

RECONNECTION

  1. If the socket is closed CLIENT will try to reconnect opening a new Socket
  2. Server creates another node
SERVER1
- status: RECONNECTING
- token: AAAABBBB
- socket: 1 (closed)
SERVER2
- status: OPEN
- token_local: CCCC
- socket: 2

CLIENT
- status: RECONNECTING
- token: AAAABBBB
- socket: 2
  1. SERVER2 sends CCCC
  2. CLIENT is PRECONNECTED
SERVER1
- status: RECONNECTING
- token: AAAABBBB
- socket: 1 (closed)
SERVER2
- status: OPEN
- token_local: CCCC
- socket: 2

CLIENT
- status: PRECONNECTED
- token: AAAABBBB
- socket: 2
  1. CLIENT sends AAAABBBB
  2. SERVER1 becomes as CONNECTED
  3. SERVER1 gets socket from SERVER2
  4. We delete SERVER2
SERVER1
- status: CONNECTED
- token: AAAABBBB
- socket: 2
SERVER2 (deleted)

CLIENT
- status: PRECONNECTED
- token: AAAABBBB
- socket: 2
  1. SERVER1 sends AAAABBBB to confirm connection on CLIENT
SERVER1
- status: CONNECTED
- token: AAAABBBB
- socket: 2

CLIENT
- status: CONNECTED
- token: AAAABBBB
- socket: 2

RECONNECTION FAILS AND BECOME A NEW CONNECTION

  1. Socket is closed and SERVER1 is deleted because of the timeout/garbage collector.
  2. CLIENT will try to reconnect opening a new Socket
  3. Server creates another node
SERVER1 (deleted)
SERVER2
- status: OPEN
- token_local: DDDD
- socket: 3

CLIENT
- status: RECONNECTING
- token: AAAABBBB
- socket: 3
  1. SERVER2 sends DDDD
  2. CLIENT is PRECONNECTING
  3. CLIENT sends AAAABBBB
SERVER2
- status: OPEN
- token_local: DDDD
- token_remote: AAAABBBB
- socket: 3

CLIENT
- status: RECONNECTING
- token_local: AAAABBBB
- token_remote: DDDD
- socket: 3
  1. CLIENT is now PRECONNECTED
  2. SERVER2 is now PRECONNECTED
  3. SERVER2 sends again DDDD
SERVER2
- status: PRECONNECTED
- token_local: DDDD
- token_remote: AAAABBBB
- socket: 3

CLIENT
- status: PRECONNECTED
- token_local: AAAABBBB
- token_remote: DDDD
- socket: 3
  1. CLIENT creates another node and transfer socket
  2. CLIENT2 sends again AAAABBBB
SERVER2
- status: PRECONNECTED
- token_local: DDDD
- token_remote: AAAABBBB
- socket: 3

CLIENT1 (deleted)
- status: PRECONNECTED
- token_local: AAAABBBB
CLIENT2
- status: CONNECTED
- token: AAAADDDD
- socket: 3
  1. SERVER2 is now connected
SERVER2
- status: CONNECTED
- token: AAAADDDD
- socket: 3

CLIENT1 (deleted)
CLIENT2
- status: CONNECTED
- token: AAAADDDD
- socket: 3

DISCONNECTION

  1. If any node sends the token as instructions means is a formal disconnection. And can't be recovered.
  2. CLIENT sends AAAADDDD
SERVER2
- status: DISCONNECTED
- token: AAAADDDD
- socket: 3 (closed)

CLIENT2
- status: DISCONNECTED
- token: AAAADDDD
- socket: 3 (closed)
3.0.0-rc1

5 years ago

2.0.14

5 years ago

2.0.13

5 years ago

2.0.12

5 years ago

2.0.11

6 years ago

2.0.10

6 years ago

2.0.9

6 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago