Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #215 from Belchy06/issue-203
Browse files Browse the repository at this point in the history
Fix: Reconnects will be attempted even when a disconnect is triggered by afk timeout
  • Loading branch information
mcottontensor authored May 3, 2023
2 parents 28d079d + b6b26a0 commit 79a1de6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Frontend/library/src/PixelStreaming/PixelStreaming.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ describe('PixelStreaming', () => {
expect(webSocketSpyFunctions.constructorSpy).toHaveBeenCalledTimes(1);
expect(webSocketSpyFunctions.closeSpy).not.toHaveBeenCalled();

pixelStreaming.disconnect();
pixelStreaming.webSocketController.close();

expect(webSocketSpyFunctions.closeSpy).toHaveBeenCalled();

Expand Down
4 changes: 2 additions & 2 deletions Frontend/library/src/PixelStreaming/PixelStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export interface PixelStreamingOverrides {
* this will likely be the core of your Pixel Streaming experience in terms of functionality.
*/
export class PixelStreaming {
private _webRtcController: WebRtcPlayerController;
private _webXrController: WebXRController;
protected _webRtcController: WebRtcPlayerController;
protected _webXrController: WebXRController;
/**
* Configuration object. You can read or modify config through this object. Whenever
* the configuration is changed, the library will emit a `settingsChanged` event.
Expand Down
2 changes: 2 additions & 0 deletions Frontend/library/src/WebRtcPlayer/WebRtcPlayerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,8 @@ export class WebRtcPlayerController {
* Close the Connection to the signaling server
*/
closeSignalingServer() {
// We explicitly called close, therefore we don't want to trigger auto reconnect
this.shouldReconnect = false;
this.webSocketController?.close();
}

Expand Down

0 comments on commit 79a1de6

Please sign in to comment.