-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PeerConnectionのCreate/Closeでエラーが発生しても処理を継続するように変更 (#9)
Co-authored-by: Takuya Okita <takuya10@gmail.com>
- Loading branch information
1 parent
092011a
commit aebd0e1
Showing
11 changed files
with
92 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#if !UNITY_WEBGL || UNITY_EDITOR | ||
namespace Extreal.Integration.P2P.WebRTC.MVS.ClientControl | ||
{ | ||
public class NativeFailureClient | ||
{ | ||
public static void NativeFailureHook(NativePeerClient peerClient) | ||
{ | ||
peerClient.AddPcCreateHook((id, isOffer, pc) => throw new System.Exception("PeerClient Create Error Test")); | ||
peerClient.AddPcCloseHook(id => throw new System.Exception("PeerClient Close Error Test")); | ||
} | ||
} | ||
} | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#if UNITY_WEBGL && !UNITY_EDITOR | ||
using Extreal.Integration.Web.Common; | ||
|
||
namespace Extreal.Integration.P2P.WebRTC.MVS.ClientControl | ||
{ | ||
public class WebGLFailureClient | ||
{ | ||
public static void FailureConnect() => WebGLHelper.CallAction("failure"); | ||
} | ||
} | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { PeerClientProvider } from "@extreal-dev/extreal.integration.p2p.webrtc"; | ||
|
||
class FailureClient { | ||
private static createPc = (id: string, isOffer: boolean, pc: RTCPeerConnection) => { | ||
throw new Error("CreatePeerClient Error Test"); | ||
}; | ||
|
||
private static closePc = (id: string) => { | ||
throw new Error("ClosePeerClient Error Test"); | ||
}; | ||
|
||
static failureHook(getPeerClient: PeerClientProvider) { | ||
getPeerClient().addPcCreateHook(FailureClient.createPc) | ||
getPeerClient().addPcCloseHook(FailureClient.closePc); | ||
} | ||
} | ||
|
||
export { FailureClient }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import { addAction } from "@extreal-dev/extreal.integration.web.common"; | ||
import { PeerAdapter } from "@extreal-dev/extreal.integration.p2p.webrtc"; | ||
import { DataChannelClient } from "./DataChannelClient"; | ||
import { FailureClient } from "./FailureClient"; | ||
|
||
|
||
const peerAdapter = new PeerAdapter(); | ||
peerAdapter.adapt(); | ||
|
||
let dataChannelClient: DataChannelClient; | ||
addAction("start", () => dataChannelClient = new DataChannelClient(peerAdapter.getPeerClient)); | ||
addAction("clear", () => dataChannelClient.clear); | ||
addAction("failure", () => FailureClient.failureHook(peerAdapter.getPeerClient)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters