Unity version of abstract Signaler doesn't work without modifications to base class
For use of the Signaler class in the Microsoft.MixedReality.WebRTC.Unity namespace, it is expected that the class is abstract and should be extended. There are four events that are used by the PeerConnection class and others to handle rtc messaging from whatever signaling server is used, indicated with the comment "Those events must be invoked by the derived class". As follows:
public event Action OnConnect;
public event Action OnDisconnect;
public event Action<Message> OnMessage;
public event Action<Exception> OnFailure;
The problem is that events can only be invoked from the class they are declared in and can not be invoked in deriving classes, so in order to make this functionality work, modifications to the webrtc code have to be made for basic implementation (unless you manually handle the RTC events and basically step around the PeerConnection implementation). In fact, the example NodeDssSignaler does not use the events and instead has it's own IEnumerator method that processes messages and calls methods on the WebRTC.PeerConnection itself, which is a duplication of the code in the Unity Signaler class.
If the intent is that this Unity code is supposed to be usable "out of the box", then some method of invoking these events should be added (some protected methods probably) and the NodeDssSignaler should probably be updated to use the complete pattern in the Signaler. If the intent is that this Unity code is an example, I feel that it should be marked as such.
Hi @pnolen I agree this is a bit of a mess at the moment, first because the signaler was changed mid-way to not use an interface anymore, and second because we have a single demo implementation and so are lacking a real-world implementation to validate it properly.
To answer your questions, NodeDssSignaler is demo-level code and should not be used in production, but the original intent was that Signaler be extended by the user, so working out of the box. We have not settled yet on what approach is the most suited, either via events like the API suggests, or via direct calls like NodeDssSignaler does in practice, and I am open to suggestion on which one is more suited.