Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow sending strings through data channels
  • Loading branch information
ferjm committed Jun 29, 2020
1 parent 82260a9 commit 2c5fc3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/script/dom/rtcdatachannel.rs
Expand Up @@ -274,7 +274,11 @@ impl RTCDataChannelMethods for RTCDataChannel {
// fn SetBinaryType(&self, value: DOMString) -> ();

// https://www.w3.org/TR/webrtc/#dom-rtcdatachannel-send
fn Send(&self, data: USVString) -> () {}
fn Send(&self, data: USVString) -> () {
if let Err(error) = self.channel.send(&data.0) {
warn!("Could not send data channel message. Error: {:?}", error);
}
}

// https://www.w3.org/TR/webrtc/#dom-rtcdatachannel-send!overload-1
fn Send_(&self, data: &Blob) -> () {}
Expand Down

0 comments on commit 2c5fc3b

Please sign in to comment.