From 77d73a62d507dc5ca85e46303fb6e8f26aafac5b Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Tue, 13 Apr 2021 18:18:59 +0000 Subject: [PATCH] Document SctpTransport This also creates a g3doc directory under pc/ Bug: webrtc:12552 Change-Id: I0913c88831658776a0f02174b57b539ac85b4a9f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215077 Reviewed-by: Artem Titov Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#33718} --- g3doc/sitemap.md | 3 ++- pc/g3doc/sctp_transport.md | 44 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 pc/g3doc/sctp_transport.md diff --git a/g3doc/sitemap.md b/g3doc/sitemap.md index 297ac5323b..d7445c5b44 100644 --- a/g3doc/sitemap.md +++ b/g3doc/sitemap.md @@ -8,8 +8,9 @@ * Network * [ICE](/p2p/g3doc/ice.md) * STUN - * DTLS * TURN + * DTLS + * [SCTP](/pc/g3doc/sctp_transport.md) * Congestion control and bandwidth estimation * Audio * AudioEngine diff --git a/pc/g3doc/sctp_transport.md b/pc/g3doc/sctp_transport.md new file mode 100644 index 0000000000..254e264b0b --- /dev/null +++ b/pc/g3doc/sctp_transport.md @@ -0,0 +1,44 @@ + + + + +# SctpTransport + +## webrtc::SctpTransport + +The [`webrtc::SctpTransport`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/sctp_transport.h;l=33?q=class%20webrtc::SctpTransport) class encapsulates an SCTP association, and exposes a +few properties of this association to the WebRTC user (such as Chrome). + +The SctpTransport is used to support Datachannels, as described in the [WebRTC +specification for the Peer-to-peer Data +API](https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api). + +The public interface ([`webrtc::SctpTransportInterface`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/sctp_transport_interface.h?q=webrtc::SctpTransportInterface)) exposes an observer +interface where the user can define a callback to be called whenever the state +of an SctpTransport changes; this callback is called on the network thread (as +set during PeerConnectionFactory initialization). + +The implementation of this object lives in pc/sctp_transport.{h,cc}, and is +basically a wrapper around a `cricket::SctpTransportInternal`, hiding its +implementation details and APIs that shoudldn't be accessed from the user. + +The `webrtc::SctpTransport` is a ref counted object; it should be regarded +as owned by the PeerConnection, and will be closed when the PeerConnection +closes, but the object itself may survive longer than the PeerConnection. + +## cricket::SctpTransportInternal + +[`cricket::SctpTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/sctp/sctp_transport_internal.h?q=cricket::SctpTransportInternal) owns two objects: The SCTP association object (currently +implemented by wrapping the usrsctp library) and the DTLS transport, which is +the object used to send and receive messages as emitted from or consumed by the +usrsctp library. + +It communicates state changes and events using sigslot. + +See header files for details. + + + + + +