[rtcweb] Not an API proposal

Martin Thomson <martin.thomson@gmail.com> Tue, 12 March 2013 14:08 UTC

Return-Path: <martin.thomson@gmail.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3271D21F88D6 for <rtcweb@ietfa.amsl.com>; Tue, 12 Mar 2013 07:08:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.473
X-Spam-Level:
X-Spam-Status: No, score=-4.473 tagged_above=-999 required=5 tests=[AWL=-1.475, BAYES_00=-2.599, HTML_MESSAGE=0.001, J_CHICKENPOX_29=0.6, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ji+snvkQQQ+4 for <rtcweb@ietfa.amsl.com>; Tue, 12 Mar 2013 07:08:10 -0700 (PDT)
Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by ietfa.amsl.com (Postfix) with ESMTP id 6349021F859B for <rtcweb@ietf.org>; Tue, 12 Mar 2013 07:08:10 -0700 (PDT)
Received: by mail-wg0-f54.google.com with SMTP id fm10so6345767wgb.9 for <rtcweb@ietf.org>; Tue, 12 Mar 2013 07:08:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=hjLexLH+aJkadixZXWHhhL6iMa7gkdA3Mz/Y4/9xnBo=; b=uxriBucXz4ZBT9NfXvSKhWinPGPO/2giIDQoGS5dbu09LXkK8Wruq29BocUVAUaVme VKirozSuzgCbbI80miL3nyUAnHelE3WEruA7dmmceMxk2lVfcHfsXdNYSG4IzsDR4WOl e08aQuX5/L/TWOIYNKtKlRcQZd9y+nG94qQOUcmP3egbxWy0OQh5L8f2gQkcAeaQ2kI0 l8NJIgdwaVP2gKJpdFRr6gzhjfneiM1xhPJSpd5pE4Ey7VFsCeZkHTLPdiw4ae0PHwfD enMuEYvIJEizRlg1n7fQ602AAXGivN628uZOK34ht/7W1SXilUnj+54VVAWWJdHBLTeN 7G1g==
MIME-Version: 1.0
X-Received: by 10.194.76.37 with SMTP id h5mr27233365wjw.21.1363097289528; Tue, 12 Mar 2013 07:08:09 -0700 (PDT)
Received: by 10.194.5.135 with HTTP; Tue, 12 Mar 2013 07:08:09 -0700 (PDT)
Date: Tue, 12 Mar 2013 10:08:09 -0400
Message-ID: <CABkgnnWPX-SMS1VPnZ4jkofNTKH1R91g4v7iQKYCyXWsV3xphQ@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
To: "rtcweb@ietf.org" <rtcweb@ietf.org>
Content-Type: multipart/alternative; boundary="047d7bb03bc4bc9fbc04d7bad15c"
Subject: [rtcweb] Not an API proposal
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtcweb>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Mar 2013 14:08:11 -0000

Keep in mind that this isn't the W3C.  This would be illustrative only.

partial interface RTCPeerConnection {
    RTCDataChannel createDataChannel(optional DataChannelProperties
properties);
    EventHandler ondatachannel;
};

dictionary DataChannelProperties {
    unsigned short streamId = (next available value);
    boolean ordered = true;
    long rtxCount = (really really big);
    long rtxTime = (really really big);
    [Clamp] unsigned short binaryPpid = (registered webrtc binary PPID);
    DOMString label = "";
    DOMString protocol = null;
};

interface RTCDataChannel {
    unsigned short streamId;
    boolean ordered;
    long rtxCount;
    long rtxTime;
    short binaryPpid;
    DOMString label;
    DOMString protocol;
};
RTCDataChannel implements WebSocket;

DataChannelMessageEvent : Event {
     short binaryPpid;
};

Usage for reliable, ordered text (basically the same as websockets):

var dc = pc.createDataChannel();
dc.send(text);
dc.onmessage = function(e) {
    console.log(e.message);
};

Advanced usage for something else...on request.  I need to pay more
attention to the session.