Expose remoteMaxMessageSize on peer-connection
@@ -84,6 +84,7 @@ public:
bool hasMedia() const;
optional<Description> localDescription() const;
optional<Description> remoteDescription() const;
+ size_t remoteMaxMessageSize() const;
optional<string> localAddress() const;
optional<string> remoteAddress() const;
uint16_t maxDataChannelId() const;
@@ -214,6 +214,8 @@ RTC_C_EXPORT int rtcGetSelectedCandidatePair(int pc, char *local, int localSize,
RTC_C_EXPORT int rtcGetMaxDataChannelStream(int pc);
+RTC_C_EXPORT int rtcGetRemoteMaxMessageSize(int pc);
+
// DataChannel, Track, and WebSocket common API
RTC_C_EXPORT int rtcSetOpenCallback(int id, rtcOpenCallbackFunc cb);
@@ -697,6 +697,13 @@ int rtcGetMaxDataChannelStream(int pc) {
});
}
+int rtcGetRemoteMaxMessageSize(int pc) {
+ return wrap([&] {
+ auto peerConnection = getPeerConnection(pc);
+ return int(peerConnection->remoteMaxMessageSize());
+ });
+}
int rtcSetOpenCallback(int id, rtcOpenCallbackFunc cb) {
return wrap([&] {
auto channel = getChannel(id);
@@ -69,6 +69,8 @@ optional<Description> PeerConnection::remoteDescription() const {
return impl()->remoteDescription();
+size_t PeerConnection::remoteMaxMessageSize() const { return impl()->remoteMaxMessageSize(); }
bool PeerConnection::hasMedia() const {
auto local = localDescription();
return local && local->hasAudioOrVideo();