W3C home > Mailing lists > Public > public-webrtc@w3.org > June 2012

Spec question: Async setLocal/setRemoteDescription?

From: Justin Uberti <juberti@google.com>
Date: Fri, 15 Jun 2012 14:02:10 -0400
Message-ID: <CAOJ7v-1eYR59fg_QG04f_CBTD=uSPdW2urcgZWV-po810s9BKw@mail.gmail.com>
To: public-webrtc@w3.org
We recently changed createOffer/createAnswer to be async, since they may
need to reach down into the media layer to get their information. Since
setLocal/setRemoteDescription need to reach down to actually set the
supplied descriptions, it seems like these operations will also need to
report their success/failure asynchronously.

Suggestion: Like createOffer/createAnswer, allow callbacks to be specified
to indicate success/failure:

e.g.

void setLocalDescription<http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-setLocalDescription-void-SdpType-action-SessionDescription-description>(
SessionDescription<http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-SessionDescription>description,
    optional voidCallback successCallback,
    optional PeerConnectionErrorCallback failureCallback);

void setRemoteDescription<http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-setRemoteDescription-void-SdpType-action-SessionDescription-description>(
SessionDescription<http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-SessionDescription>description,
    optional voidCallback successCallback,
    optional PeerConnectionErrorCallback failureCallback);

successCallback would be invoked upon successful application of the
description. failureCallback would be invoked if the description was a
valid description, but could not be applied at the media layer. An
exception would be thrown if the description was not valid (e.g. failed to
parse).

If failureCallback was invoked, the session's media state would be kept as
it was before the call. (This may involve rollback, if the description was
partially applied when the failure occurred; another option would be to
simply make this a fatal callback).

localDescription and remoteDescription would return the previous
description until the new description was completely applied.
Received on Friday, 15 June 2012 18:02:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:28 UTC