Disable ICE Trickling

ICE trickling is a process where candidate-pairs are shared as soon as gathered by the ICEAgent.

Its true that, there is NO JavaScript API "currently" available in RTCWeb drafts to disable ICE-trickling process however, there is a trick that can be used to merge all candidate pairs in the session-description, and then you merely need to share that "single" SDP only.

The trick is simple: Wait until "end-of-candidate" signal is fired.

Usually "onicecandidate" event returns "NULL" entry for "event.candidate" object.

In "old-good" days, we were watching for "oniceconnectionstatechange" event, and checking for "peer.iceGatheringState === 'complete'" to return the SDP.

BTW, you can still listen for both "end-of-candidate" NULL value, as well as "peer.iceGatheringState === 'complete'".

peer.oniceconnectionstatechange = function(event) {
    if (peer.iceGatheringState === 'complete') {
        send_sdp_to_remote_peer();
    }
};

peer.onicecandidate = function(event) {
    if (event.candidate === null) {
        return send_sdp_to_remote_peer();
    }
};

var isSdpSent = false;

function send_sdp_to_remote_peer() {
    if (isSdpSent) return;
    isSdpSent = true;
  
    var sdp = peer.localDescription;
    socket.emit('remote-sdp', sdp);
}


WebRTC for ASP.NET developers

This post links some demos and tutorials for ASP.NET webforms and ASP.NET MVC developers to quick start and implement WebRTC in their applications.

First of all, please don't forget to check this post: I want to learn WebRTC!

Here is a simple one-to-one ASP.NET MVC based demo & source code:
Here is ASP.NET webforms based demo:

This demo uses MS-SQL to store SDP and ICE messages and to sync the data among room participants. This demo is having following functionalities:
  1. Private/Public rooms creations
  2. Password protected rooms
  3. MS-SQL for signaling and presence detection
  4. One-to-One connections
  5. List of a public rooms, stats of each room, number of users in each room etc.

There is another XHR-based signaling demo and source code that can fit in any WebRTC application and demo:

This demo is having following features:
  1. It can be used in any WebRTC Experiment
  2. It uses MS-SQL for signaling
  3. It supports re-usability of the code
  4. It can be used with RTCMultiConnection.js and DataChannel.js
Here is how it can be used in RTCMultiConnection demos:
There is another implementation and source code that uses WebSync:
WebSync is an implementation of the Bayeux specification, commonly known as "comet", for the .NET framework and IIS. Ref
Try WebSync demos in action:
For those who wanna use SignalR instead:
P.S. This post will be updated for future ASP.NET based WebRTC demos e.g. SignalR demos.