Spec question: Async setLocal/setRemoteDescription?

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