teleportxr 1.0.79 → 1.0.80
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/package.json +1 -1
- package/signaling.js +10 -17
package/package.json
CHANGED
package/signaling.js
CHANGED
|
@@ -129,25 +129,18 @@ function processInitialRequest(clientID, signalingClient, content) {
|
|
|
129
129
|
// if signalingState is START, we should not have a client...
|
|
130
130
|
if (signalingClient.signalingState==SignalingState.ACCEPTED||signalingClient.signalingState==SignalingState.STREAMING)
|
|
131
131
|
{
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
//
|
|
132
|
+
// The client sent us another "connect" while we already hold an active
|
|
133
|
+
// session for them — most likely the client's discovery loop ticked again
|
|
134
|
+
// before the client's connection-status guard kicked in. Respond
|
|
135
|
+
// idempotently: re-send the connect-response so the client knows we still
|
|
136
|
+
// recognise it, and do nothing else. Do NOT tear down the Client /
|
|
137
|
+
// WebRtcConnection, and do NOT re-run startStreaming — both would destroy
|
|
138
|
+
// the live transport (in particular leaving SetOriginNodeCommand /
|
|
139
|
+
// SetLightingCommand without a reliable data channel to be acked on).
|
|
136
140
|
console.log(
|
|
137
|
-
"Warning: Client " +
|
|
138
|
-
clientID +
|
|
139
|
-
" reconnected, but we didn't know we'd lost them."
|
|
141
|
+
"Warning: Client " + clientID + " sent another connect; resending connect-response."
|
|
140
142
|
);
|
|
141
|
-
|
|
142
|
-
// Without this the next handshake's StartStreaming() races against the old
|
|
143
|
-
// peer connection's still-open data channels, and the reliable channel the
|
|
144
|
-
// server publishes commands to ends up being the wrong one — Origin/Lighting
|
|
145
|
-
// acks never come back and the server eventually gives up.
|
|
146
|
-
disconnectClient(clientID);
|
|
147
|
-
if (webRtcConnectionManager)
|
|
148
|
-
webRtcConnectionManager.destroyConnection(clientID);
|
|
149
|
-
signalingClient.ChangeSignalingState(SignalingState.START);
|
|
150
|
-
startStreaming(signalingClient);
|
|
143
|
+
sendResponseToClient(clientID);
|
|
151
144
|
return;
|
|
152
145
|
}
|
|
153
146
|
if (signalingClient.signalingState==SignalingState.REQUESTED)
|