Re: [rtcweb] Another approach to forking...

Randell Jesup <> Fri, 23 September 2011 15:30 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 62BF821F8CD3 for <>; Fri, 23 Sep 2011 08:30:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.611
X-Spam-Status: No, score=-2.611 tagged_above=-999 required=5 tests=[AWL=-0.012, BAYES_00=-2.599]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id pkweubRLM45O for <>; Fri, 23 Sep 2011 08:30:32 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 589BA21F8CD0 for <>; Fri, 23 Sep 2011 08:30:32 -0700 (PDT)
Received: from ([] helo=[]) by with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from <>) id 1R77kQ-0002tF-7R for; Fri, 23 Sep 2011 10:33:06 -0500
Message-ID: <>
Date: Fri, 23 Sep 2011 11:29:33 -0400
From: Randell Jesup <>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1
MIME-Version: 1.0
References: <>
In-Reply-To: <>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname -
X-AntiAbuse: Original Domain -
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain -
Subject: Re: [rtcweb] Another approach to forking...
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 23 Sep 2011 15:30:33 -0000

On 9/23/2011 8:58 AM, Harald Alvestrand wrote:
> Just to confuse the forking issue still further:
> If the APIs remain as they are today, a JS application that wants to 
> support forking can do the following:
> - Create a PeerConnection
> - Cause it to generate an SDP blob ("SDP OFFER")
> - Send that SDP blob out to be forked
> - Throw away the PeerConnection
> - As the answers come back, for each answer:
>   - Create a new PeerConnection
>   - Take out the SDP blob, put "SDP OFFER" at the top, and give it to 
> the PeerConnection
>   - Throw away the generated "SDP ANSWER"
> Then connect all the media to output devices as appropriate, and shut 
> them down one by one as the application decides that these were not 
> the connections that would last.
> For extra safety, cause the PeerConnection to do a renegotiation at an 
> appropriate time, so that both sides have seen an SDP OFFER/ANSWER 
> exchange that actually came from the other side.
> It requires a little bit of insight into the SDP offer/answer model, 
> and it's a pity to have to resort to string manipulation at any level, 
> but .... it doesn't seem anywhere near impossible. Not even 
> particularly architecture-breaking.

Evil (kinda), but effective in practice.  I'd prefer the ability to effectively 'clone'
a PeerConnection object on receipt of (another) speculative answer (see my earlier
proposal), removing the need to play games like above.  This requires keeping in the
PeerConnection any necessary state to reproduce the necessary object state on a new
speculative (or final) answer.  Seems fairly straightforward.  Alternatively you
could use a model where an offer was done via a PeerConnectionOffer object, and on a
(speculative or final) answer a connected PeerConnection object is produced by it.
When the app is done and has decided "no more forks accepted" (for example on an ACCEPT
per my proposal), it would kill the PeerConnectionOffer and any PeerConnections it didn't
want to keep.  This is a bit 'cleaner' an API in my mind than just PeerConnections with
some sort of fork/clone method, but that's minor and a personal preference.

Randell Jesup