Re: [webrtc-pc] No way to register for transport events in DataChannel-only initial negotiation (#2899)

> ... it prevents a bunch of irrelevant default values in case it is not negotiated / not used

I don't see a "bunch", only `maxMessageSize` as mentioned:
```webidl
interface RTCSctpTransport : EventTarget {
  readonly attribute RTCDtlsTransport transport;
  readonly attribute RTCSctpTransportState state;
  readonly attribute unrestricted double maxMessageSize;
  readonly attribute unsigned short? maxChannels;
  attribute EventHandler onstatechange;
};
```
[maxChannels](https://w3c.github.io/webrtc-pc/#dom-rtcsctptransport-maxchannels) is already nullable, and _"will be null until the SCTP transport goes into the `"connected"` state."_
[state](https://w3c.github.io/webrtc-pc/#dom-rtcsctptransport-state) starts out as `"connecting"` which still works as initial state I think once exposed in sLD.

> If we were to switch this around and make the sctp property itself non-nullable,

No, `sctp` would remain nullable, like all transports to be surfaced in sLD.

> but properties like maxMessageSize inside it nullable, then suddenly maxMessageSize would be of type number | null in TypeScript. 

Since this is already the case with `maxChannels`, this doesn't seem like a big difference.

> Edit: We also discussed a while ago that SCTP is different to the other transports. It does not allow for any kind of renegotiation by use of SDP, so this design remains plausible for the lifetime of the peer connection. 

I believe SCTP can be added in renegotiation, just not removed? In any case, what difference does that make toward solving the OP problem?

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2899#issuecomment-1696624770 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 29 August 2023 01:08:42 UTC