@replit/river 0.26.0 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-KP4UB5NW.js → chunk-AWCUCZY4.js} +2 -2
- package/dist/{chunk-5S64PXTU.js → chunk-IV27BICV.js} +36 -9
- package/dist/chunk-IV27BICV.js.map +1 -0
- package/dist/{chunk-5FDAIAQ5.js → chunk-M5X4JTU3.js} +5 -5
- package/dist/chunk-M5X4JTU3.js.map +1 -0
- package/dist/{chunk-CCUYKR5C.js → chunk-M75K5TJS.js} +2 -2
- package/dist/{chunk-CCUYKR5C.js.map → chunk-M75K5TJS.js.map} +1 -1
- package/dist/{chunk-BNNELZM4.js → chunk-MREEJE3X.js} +2 -2
- package/dist/{chunk-JSU2KACV.js → chunk-NC54BC47.js} +98 -35
- package/dist/chunk-NC54BC47.js.map +1 -0
- package/dist/{chunk-7ETNUCOL.js → chunk-YQABPD3C.js} +29 -14
- package/dist/chunk-YQABPD3C.js.map +1 -0
- package/dist/{client-162c509c.d.ts → client-654098be.d.ts} +2 -4
- package/dist/{connection-6a404bb8.d.ts → connection-bc2454dc.d.ts} +1 -1
- package/dist/{handshake-3342bb94.d.ts → handshake-1a86f06d.d.ts} +60 -42
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/{message-1a434848.d.ts → message-57296605.d.ts} +2 -1
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +8 -8
- package/dist/router/index.d.ts +8 -8
- package/dist/router/index.js +2 -2
- package/dist/{server-1b695374.d.ts → server-9a6b5a8e.d.ts} +12 -4
- package/dist/{services-c17f7eff.d.ts → services-7daa60a0.d.ts} +3 -3
- package/dist/transport/impls/ws/client.cjs +131 -41
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +4 -4
- package/dist/transport/impls/ws/client.d.ts +4 -4
- package/dist/transport/impls/ws/client.js +5 -5
- package/dist/transport/impls/ws/server.cjs +124 -46
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +4 -4
- package/dist/transport/impls/ws/server.d.ts +4 -4
- package/dist/transport/impls/ws/server.js +5 -5
- package/dist/transport/index.cjs +156 -51
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +4 -4
- package/dist/transport/index.d.ts +4 -4
- package/dist/transport/index.js +5 -5
- package/dist/util/testHelpers.cjs +97 -34
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +4 -4
- package/dist/util/testHelpers.d.ts +4 -4
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-5FDAIAQ5.js.map +0 -1
- package/dist/chunk-5S64PXTU.js.map +0 -1
- package/dist/chunk-7ETNUCOL.js.map +0 -1
- package/dist/chunk-JSU2KACV.js.map +0 -1
- /package/dist/{chunk-KP4UB5NW.js.map → chunk-AWCUCZY4.js.map} +0 -0
- /package/dist/{chunk-BNNELZM4.js.map → chunk-MREEJE3X.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { b as ClientTransportOptions, C as Connection, j as EventHandler, E as EventMap, i as EventTypes, k as ProtocolError, l as ProtocolErrorType, c as ServerTransportOptions, S as Session, h as SessionConnected, f as SessionConnecting, g as SessionHandshaking, e as SessionNoConnection, d as SessionState, T as Transport, P as TransportOptions, a as TransportStatus } from '../handshake-
|
|
2
|
-
export { C as ClientTransport } from '../client-
|
|
3
|
-
export { S as ServerTransport, a as SessionWaitingForHandshake } from '../server-
|
|
4
|
-
export { b as OpaqueTransportMessage, O as OpaqueTransportMessageSchema, c as TransportClientId, a as TransportMessage, T as TransportMessageSchema, d as isStreamClose, i as isStreamOpen } from '../message-
|
|
1
|
+
export { b as ClientTransportOptions, C as Connection, j as EventHandler, E as EventMap, i as EventTypes, k as ProtocolError, l as ProtocolErrorType, c as ServerTransportOptions, S as Session, h as SessionConnected, f as SessionConnecting, g as SessionHandshaking, e as SessionNoConnection, d as SessionState, T as Transport, P as TransportOptions, a as TransportStatus } from '../handshake-1a86f06d.js';
|
|
2
|
+
export { C as ClientTransport } from '../client-654098be.js';
|
|
3
|
+
export { S as ServerTransport, a as SessionWaitingForHandshake } from '../server-9a6b5a8e.js';
|
|
4
|
+
export { b as OpaqueTransportMessage, O as OpaqueTransportMessageSchema, c as TransportClientId, a as TransportMessage, T as TransportMessageSchema, d as isStreamClose, i as isStreamOpen } from '../message-57296605.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
7
7
|
import '@sinclair/typebox/value';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { b as ClientTransportOptions, C as Connection, j as EventHandler, E as EventMap, i as EventTypes, k as ProtocolError, l as ProtocolErrorType, c as ServerTransportOptions, S as Session, h as SessionConnected, f as SessionConnecting, g as SessionHandshaking, e as SessionNoConnection, d as SessionState, T as Transport, P as TransportOptions, a as TransportStatus } from '../handshake-
|
|
2
|
-
export { C as ClientTransport } from '../client-
|
|
3
|
-
export { S as ServerTransport, a as SessionWaitingForHandshake } from '../server-
|
|
4
|
-
export { b as OpaqueTransportMessage, O as OpaqueTransportMessageSchema, c as TransportClientId, a as TransportMessage, T as TransportMessageSchema, d as isStreamClose, i as isStreamOpen } from '../message-
|
|
1
|
+
export { b as ClientTransportOptions, C as Connection, j as EventHandler, E as EventMap, i as EventTypes, k as ProtocolError, l as ProtocolErrorType, c as ServerTransportOptions, S as Session, h as SessionConnected, f as SessionConnecting, g as SessionHandshaking, e as SessionNoConnection, d as SessionState, T as Transport, P as TransportOptions, a as TransportStatus } from '../handshake-1a86f06d.js';
|
|
2
|
+
export { C as ClientTransport } from '../client-654098be.js';
|
|
3
|
+
export { S as ServerTransport, a as SessionWaitingForHandshake } from '../server-9a6b5a8e.js';
|
|
4
|
+
export { b as OpaqueTransportMessage, O as OpaqueTransportMessageSchema, c as TransportClientId, a as TransportMessage, T as TransportMessageSchema, d as isStreamClose, i as isStreamOpen } from '../message-57296605.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
7
7
|
import '@sinclair/typebox/value';
|
package/dist/transport/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientTransport
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-IV27BICV.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-YQABPD3C.js";
|
|
7
7
|
import {
|
|
8
8
|
Connection,
|
|
9
9
|
ProtocolError,
|
|
10
10
|
Transport
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-M5X4JTU3.js";
|
|
12
12
|
import "../chunk-TAH2GVTJ.js";
|
|
13
13
|
import {
|
|
14
14
|
SessionState
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-NC54BC47.js";
|
|
16
16
|
import {
|
|
17
17
|
OpaqueTransportMessageSchema,
|
|
18
18
|
TransportMessageSchema
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-M75K5TJS.js";
|
|
20
20
|
import "../chunk-4PVU7J25.js";
|
|
21
21
|
export {
|
|
22
22
|
ClientTransport,
|
|
@@ -460,7 +460,7 @@ function Err(error) {
|
|
|
460
460
|
var import_api = require("@opentelemetry/api");
|
|
461
461
|
|
|
462
462
|
// package.json
|
|
463
|
-
var version = "0.26.
|
|
463
|
+
var version = "0.26.2";
|
|
464
464
|
|
|
465
465
|
// tracing/index.ts
|
|
466
466
|
function createSessionTelemetryInfo(sessionId, to, from, propagationCtx) {
|
|
@@ -549,6 +549,7 @@ var defaultTransportOptions = {
|
|
|
549
549
|
sessionDisconnectGraceMs: 5e3,
|
|
550
550
|
connectionTimeoutMs: 2e3,
|
|
551
551
|
handshakeTimeoutMs: 1e3,
|
|
552
|
+
enableTransparentSessionReconnects: true,
|
|
552
553
|
codec: NaiveJsonCodec
|
|
553
554
|
};
|
|
554
555
|
var defaultConnectionRetryOptions = {
|
|
@@ -710,9 +711,32 @@ var IdentifiedSession = class extends CommonSession {
|
|
|
710
711
|
this.telemetry.span.end();
|
|
711
712
|
}
|
|
712
713
|
};
|
|
714
|
+
var IdentifiedSessionWithGracePeriod = class extends IdentifiedSession {
|
|
715
|
+
graceExpiryTime;
|
|
716
|
+
gracePeriodTimeout;
|
|
717
|
+
listeners;
|
|
718
|
+
constructor(props) {
|
|
719
|
+
super(props);
|
|
720
|
+
this.listeners = props.listeners;
|
|
721
|
+
this.graceExpiryTime = props.graceExpiryTime;
|
|
722
|
+
this.gracePeriodTimeout = setTimeout(() => {
|
|
723
|
+
this.listeners.onSessionGracePeriodElapsed();
|
|
724
|
+
}, this.graceExpiryTime - Date.now());
|
|
725
|
+
}
|
|
726
|
+
_handleStateExit() {
|
|
727
|
+
super._handleStateExit();
|
|
728
|
+
if (this.gracePeriodTimeout) {
|
|
729
|
+
clearTimeout(this.gracePeriodTimeout);
|
|
730
|
+
this.gracePeriodTimeout = void 0;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
_handleClose() {
|
|
734
|
+
super._handleClose();
|
|
735
|
+
}
|
|
736
|
+
};
|
|
713
737
|
|
|
714
738
|
// transport/sessionStateMachine/SessionConnecting.ts
|
|
715
|
-
var SessionConnecting = class extends
|
|
739
|
+
var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
|
|
716
740
|
state = "Connecting" /* Connecting */;
|
|
717
741
|
connPromise;
|
|
718
742
|
listeners;
|
|
@@ -745,8 +769,10 @@ var SessionConnecting = class extends IdentifiedSession {
|
|
|
745
769
|
}
|
|
746
770
|
_handleStateExit() {
|
|
747
771
|
super._handleStateExit();
|
|
748
|
-
|
|
749
|
-
|
|
772
|
+
if (this.connectionTimeout) {
|
|
773
|
+
clearTimeout(this.connectionTimeout);
|
|
774
|
+
this.connectionTimeout = void 0;
|
|
775
|
+
}
|
|
750
776
|
}
|
|
751
777
|
_handleClose() {
|
|
752
778
|
this.bestEffortClose();
|
|
@@ -755,26 +781,13 @@ var SessionConnecting = class extends IdentifiedSession {
|
|
|
755
781
|
};
|
|
756
782
|
|
|
757
783
|
// transport/sessionStateMachine/SessionNoConnection.ts
|
|
758
|
-
var SessionNoConnection = class extends
|
|
784
|
+
var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
|
|
759
785
|
state = "NoConnection" /* NoConnection */;
|
|
760
|
-
listeners;
|
|
761
|
-
gracePeriodTimeout;
|
|
762
|
-
constructor(props) {
|
|
763
|
-
super(props);
|
|
764
|
-
this.listeners = props.listeners;
|
|
765
|
-
this.gracePeriodTimeout = setTimeout(() => {
|
|
766
|
-
this.listeners.onSessionGracePeriodElapsed();
|
|
767
|
-
}, this.options.sessionDisconnectGraceMs);
|
|
768
|
-
}
|
|
769
786
|
_handleClose() {
|
|
770
787
|
super._handleClose();
|
|
771
788
|
}
|
|
772
789
|
_handleStateExit() {
|
|
773
790
|
super._handleStateExit();
|
|
774
|
-
if (this.gracePeriodTimeout) {
|
|
775
|
-
clearTimeout(this.gracePeriodTimeout);
|
|
776
|
-
this.gracePeriodTimeout = void 0;
|
|
777
|
-
}
|
|
778
791
|
}
|
|
779
792
|
};
|
|
780
793
|
|
|
@@ -798,7 +811,10 @@ var SessionWaitingForHandshake = class extends CommonSession {
|
|
|
798
811
|
onHandshakeData = (msg) => {
|
|
799
812
|
const parsedMsg = this.parseMsg(msg);
|
|
800
813
|
if (parsedMsg === null) {
|
|
801
|
-
this.listeners.onInvalidHandshake(
|
|
814
|
+
this.listeners.onInvalidHandshake(
|
|
815
|
+
"could not parse message",
|
|
816
|
+
"MALFORMED_HANDSHAKE"
|
|
817
|
+
);
|
|
802
818
|
return;
|
|
803
819
|
}
|
|
804
820
|
this.listeners.onHandshake(parsedMsg);
|
|
@@ -825,7 +841,7 @@ var SessionWaitingForHandshake = class extends CommonSession {
|
|
|
825
841
|
};
|
|
826
842
|
|
|
827
843
|
// transport/sessionStateMachine/SessionHandshaking.ts
|
|
828
|
-
var SessionHandshaking = class extends
|
|
844
|
+
var SessionHandshaking = class extends IdentifiedSessionWithGracePeriod {
|
|
829
845
|
state = "Handshaking" /* Handshaking */;
|
|
830
846
|
conn;
|
|
831
847
|
listeners;
|
|
@@ -844,7 +860,10 @@ var SessionHandshaking = class extends IdentifiedSession {
|
|
|
844
860
|
onHandshakeData = (msg) => {
|
|
845
861
|
const parsedMsg = this.parseMsg(msg);
|
|
846
862
|
if (parsedMsg === null) {
|
|
847
|
-
this.listeners.onInvalidHandshake(
|
|
863
|
+
this.listeners.onInvalidHandshake(
|
|
864
|
+
"could not parse message",
|
|
865
|
+
"MALFORMED_HANDSHAKE"
|
|
866
|
+
);
|
|
848
867
|
return;
|
|
849
868
|
}
|
|
850
869
|
this.listeners.onHandshake(parsedMsg);
|
|
@@ -857,7 +876,10 @@ var SessionHandshaking = class extends IdentifiedSession {
|
|
|
857
876
|
this.conn.removeDataListener(this.onHandshakeData);
|
|
858
877
|
this.conn.removeErrorListener(this.listeners.onConnectionErrored);
|
|
859
878
|
this.conn.removeCloseListener(this.listeners.onConnectionClosed);
|
|
860
|
-
|
|
879
|
+
if (this.handshakeTimeout) {
|
|
880
|
+
clearTimeout(this.handshakeTimeout);
|
|
881
|
+
this.handshakeTimeout = void 0;
|
|
882
|
+
}
|
|
861
883
|
}
|
|
862
884
|
_handleClose() {
|
|
863
885
|
super._handleClose();
|
|
@@ -937,8 +959,10 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
937
959
|
}
|
|
938
960
|
onMessageData = (msg) => {
|
|
939
961
|
const parsedMsg = this.parseMsg(msg);
|
|
940
|
-
if (parsedMsg === null)
|
|
962
|
+
if (parsedMsg === null) {
|
|
963
|
+
this.listeners.onInvalidMessage("could not parse message");
|
|
941
964
|
return;
|
|
965
|
+
}
|
|
942
966
|
if (parsedMsg.seq !== this.ack) {
|
|
943
967
|
if (parsedMsg.seq < this.ack) {
|
|
944
968
|
this.log?.debug(
|
|
@@ -995,7 +1019,7 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
995
1019
|
};
|
|
996
1020
|
|
|
997
1021
|
// transport/sessionStateMachine/SessionBackingOff.ts
|
|
998
|
-
var SessionBackingOff = class extends
|
|
1022
|
+
var SessionBackingOff = class extends IdentifiedSessionWithGracePeriod {
|
|
999
1023
|
state = "BackingOff" /* BackingOff */;
|
|
1000
1024
|
listeners;
|
|
1001
1025
|
backoffTimeout;
|
|
@@ -1032,6 +1056,12 @@ function inheritSharedSession(session) {
|
|
|
1032
1056
|
log: session.log
|
|
1033
1057
|
};
|
|
1034
1058
|
}
|
|
1059
|
+
function inheritSharedSessionWithGrace(session) {
|
|
1060
|
+
return {
|
|
1061
|
+
...inheritSharedSession(session),
|
|
1062
|
+
graceExpiryTime: session.graceExpiryTime
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1035
1065
|
var SessionStateGraph = {
|
|
1036
1066
|
entrypoints: {
|
|
1037
1067
|
NoConnection: (to, from, listeners, options, log) => {
|
|
@@ -1045,6 +1075,7 @@ var SessionStateGraph = {
|
|
|
1045
1075
|
to,
|
|
1046
1076
|
seq: 0,
|
|
1047
1077
|
ack: 0,
|
|
1078
|
+
graceExpiryTime: Date.now() + options.sessionDisconnectGraceMs,
|
|
1048
1079
|
sendBuffer,
|
|
1049
1080
|
telemetry,
|
|
1050
1081
|
options,
|
|
@@ -1076,7 +1107,7 @@ var SessionStateGraph = {
|
|
|
1076
1107
|
transition: {
|
|
1077
1108
|
// happy path transitions
|
|
1078
1109
|
NoConnectionToBackingOff: (oldSession, backoffMs, listeners) => {
|
|
1079
|
-
const carriedState =
|
|
1110
|
+
const carriedState = inheritSharedSessionWithGrace(oldSession);
|
|
1080
1111
|
oldSession._handleStateExit();
|
|
1081
1112
|
const session = new SessionBackingOff({
|
|
1082
1113
|
backoffMs,
|
|
@@ -1093,7 +1124,7 @@ var SessionStateGraph = {
|
|
|
1093
1124
|
return session;
|
|
1094
1125
|
},
|
|
1095
1126
|
BackingOffToConnecting: (oldSession, connPromise, listeners) => {
|
|
1096
|
-
const carriedState =
|
|
1127
|
+
const carriedState = inheritSharedSessionWithGrace(oldSession);
|
|
1097
1128
|
oldSession._handleStateExit();
|
|
1098
1129
|
const session = new SessionConnecting({
|
|
1099
1130
|
connPromise,
|
|
@@ -1110,7 +1141,7 @@ var SessionStateGraph = {
|
|
|
1110
1141
|
return session;
|
|
1111
1142
|
},
|
|
1112
1143
|
ConnectingToHandshaking: (oldSession, conn, listeners) => {
|
|
1113
|
-
const carriedState =
|
|
1144
|
+
const carriedState = inheritSharedSessionWithGrace(oldSession);
|
|
1114
1145
|
oldSession._handleStateExit();
|
|
1115
1146
|
const session = new SessionHandshaking({
|
|
1116
1147
|
conn,
|
|
@@ -1187,9 +1218,12 @@ var SessionStateGraph = {
|
|
|
1187
1218
|
},
|
|
1188
1219
|
// disconnect paths
|
|
1189
1220
|
BackingOffToNoConnection: (oldSession, listeners) => {
|
|
1190
|
-
const carriedState =
|
|
1221
|
+
const carriedState = inheritSharedSessionWithGrace(oldSession);
|
|
1191
1222
|
oldSession._handleStateExit();
|
|
1192
|
-
const session = new SessionNoConnection({
|
|
1223
|
+
const session = new SessionNoConnection({
|
|
1224
|
+
listeners,
|
|
1225
|
+
...carriedState
|
|
1226
|
+
});
|
|
1193
1227
|
session.log?.info(
|
|
1194
1228
|
`session ${session.id} transition from BackingOff to NoConnection`,
|
|
1195
1229
|
{
|
|
@@ -1200,10 +1234,13 @@ var SessionStateGraph = {
|
|
|
1200
1234
|
return session;
|
|
1201
1235
|
},
|
|
1202
1236
|
ConnectingToNoConnection: (oldSession, listeners) => {
|
|
1203
|
-
const carriedState =
|
|
1237
|
+
const carriedState = inheritSharedSessionWithGrace(oldSession);
|
|
1204
1238
|
oldSession.bestEffortClose();
|
|
1205
1239
|
oldSession._handleStateExit();
|
|
1206
|
-
const session = new SessionNoConnection({
|
|
1240
|
+
const session = new SessionNoConnection({
|
|
1241
|
+
listeners,
|
|
1242
|
+
...carriedState
|
|
1243
|
+
});
|
|
1207
1244
|
session.log?.info(
|
|
1208
1245
|
`session ${session.id} transition from Connecting to NoConnection`,
|
|
1209
1246
|
{
|
|
@@ -1214,10 +1251,13 @@ var SessionStateGraph = {
|
|
|
1214
1251
|
return session;
|
|
1215
1252
|
},
|
|
1216
1253
|
HandshakingToNoConnection: (oldSession, listeners) => {
|
|
1217
|
-
const carriedState =
|
|
1254
|
+
const carriedState = inheritSharedSessionWithGrace(oldSession);
|
|
1218
1255
|
oldSession.conn.close();
|
|
1219
1256
|
oldSession._handleStateExit();
|
|
1220
|
-
const session = new SessionNoConnection({
|
|
1257
|
+
const session = new SessionNoConnection({
|
|
1258
|
+
listeners,
|
|
1259
|
+
...carriedState
|
|
1260
|
+
});
|
|
1221
1261
|
session.log?.info(
|
|
1222
1262
|
`session ${session.id} transition from Handshaking to NoConnection`,
|
|
1223
1263
|
{
|
|
@@ -1229,9 +1269,14 @@ var SessionStateGraph = {
|
|
|
1229
1269
|
},
|
|
1230
1270
|
ConnectedToNoConnection: (oldSession, listeners) => {
|
|
1231
1271
|
const carriedState = inheritSharedSession(oldSession);
|
|
1272
|
+
const graceExpiryTime = Date.now() + oldSession.options.sessionDisconnectGraceMs;
|
|
1232
1273
|
oldSession.conn.close();
|
|
1233
1274
|
oldSession._handleStateExit();
|
|
1234
|
-
const session = new SessionNoConnection({
|
|
1275
|
+
const session = new SessionNoConnection({
|
|
1276
|
+
listeners,
|
|
1277
|
+
graceExpiryTime,
|
|
1278
|
+
...carriedState
|
|
1279
|
+
});
|
|
1235
1280
|
session.log?.info(
|
|
1236
1281
|
`session ${session.id} transition from Connected to NoConnection`,
|
|
1237
1282
|
{
|
|
@@ -1248,24 +1293,42 @@ var ClientSessionStateGraph = {
|
|
|
1248
1293
|
entrypoint: SessionStateGraph.entrypoints.NoConnection,
|
|
1249
1294
|
transition: {
|
|
1250
1295
|
// happy paths
|
|
1296
|
+
// NoConnection -> BackingOff: attempt to connect
|
|
1251
1297
|
NoConnectionToBackingOff: transitions.NoConnectionToBackingOff,
|
|
1298
|
+
// BackingOff -> Connecting: backoff period elapsed, start connection
|
|
1252
1299
|
BackingOffToConnecting: transitions.BackingOffToConnecting,
|
|
1300
|
+
// Connecting -> Handshaking: connection established, start handshake
|
|
1253
1301
|
ConnectingToHandshaking: transitions.ConnectingToHandshaking,
|
|
1302
|
+
// Handshaking -> Connected: handshake complete, session ready
|
|
1254
1303
|
HandshakingToConnected: transitions.HandshakingToConnected,
|
|
1255
1304
|
// disconnect paths
|
|
1305
|
+
// BackingOff -> NoConnection: unused
|
|
1256
1306
|
BackingOffToNoConnection: transitions.BackingOffToNoConnection,
|
|
1307
|
+
// Connecting -> NoConnection: connection failed or connection timeout
|
|
1257
1308
|
ConnectingToNoConnection: transitions.ConnectingToNoConnection,
|
|
1309
|
+
// Handshaking -> NoConnection: connection closed or handshake timeout
|
|
1258
1310
|
HandshakingToNoConnection: transitions.HandshakingToNoConnection,
|
|
1311
|
+
// Connected -> NoConnection: connection closed
|
|
1259
1312
|
ConnectedToNoConnection: transitions.ConnectedToNoConnection
|
|
1313
|
+
// destroy/close paths
|
|
1314
|
+
// NoConnection -> x: grace period elapsed
|
|
1315
|
+
// BackingOff -> x: grace period elapsed
|
|
1316
|
+
// Connecting -> x: grace period elapsed
|
|
1317
|
+
// Handshaking -> x: grace period elapsed or invalid handshake message or handshake rejection
|
|
1318
|
+
// Connected -> x: grace period elapsed or invalid message
|
|
1260
1319
|
}
|
|
1261
1320
|
};
|
|
1262
1321
|
var ServerSessionStateGraph = {
|
|
1263
1322
|
entrypoint: SessionStateGraph.entrypoints.WaitingForHandshake,
|
|
1264
1323
|
transition: {
|
|
1265
1324
|
// happy paths
|
|
1325
|
+
// WaitingForHandshake -> Connected: handshake complete, session ready
|
|
1266
1326
|
WaitingForHandshakeToConnected: transitions.WaitingForHandshakeToConnected,
|
|
1267
1327
|
// disconnect paths
|
|
1328
|
+
// Connected -> NoConnection: connection closed
|
|
1268
1329
|
ConnectedToNoConnection: transitions.ConnectedToNoConnection
|
|
1330
|
+
// destroy/close paths
|
|
1331
|
+
// WaitingForHandshake -> x: handshake timeout elapsed or invalid handshake message or handshake rejection or connection closed
|
|
1269
1332
|
}
|
|
1270
1333
|
};
|
|
1271
1334
|
|