• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Engineering Semester

Explore the technology

  • Home
  • About
  • Contact us

WebRTC – Send arbitrary data with RTCDataChannel API

By : VINAY KP Filed Under: networking, webRTC Leave a Comment

Now we are already familiar WebRTC technology and it’s RTCDataChannel API through our last couple of WebRTC posts . WebRTC performance is very high when we transferring video and audio . Isn’t ? As well as audio and video with the help of RTCDataChannel API , WebRTC can send arbitrary data also .  Let us start about WebRTC’s RTCDataChannel API through this post .

If your new to this WebRTC series , Please go though the last couple of post about WebRTC technology .

Introduction to WebRTC : Introduction of webRTC in Modern Browsers

getUsermedia API : Access user media with getUserMedia API

RTCPeerconnection API : Walk through WebRTC RTCPeerConnection API

RTCDataChannel API

RTCDataChannel API allows you to send real-time data over the wire . ie ) It enables peer to peer exchange of arbitrary data with low latency and high throughput . We use this API for text based chatting , file transfer , remote desktop applications etc. This WebRTC API is much faster than other application because it’s direct communication between the browsers .

There are some RTCDataChanel API event handlers used in WebRTC . It includes :

  • RTCDataChannel.onopen – This event is active when the open event is fired . It send the data when data connection has been established .
  • RTCDataChannel.onmessage -It is a message event . The event is active when the message is available on data channel .
  • RTCDataChannel.onclose – This event is active when the close event is fired . This event send a notification for data connection close .
  • RTCDataChannel.onerror – Error handling event .

These are the 2 main methods used in theRTCDataChanel API :

  • RTCDataChannel.close( ) – This method close the data channel  .
  • RTCDataChannel.send( ) – Method helps to send the data over the channel . It can send data as bulb , string or an ArrayBuffer .

If you are interested and you want to test with writing webRTC application from scratch , Just go though our posts ,  Write a WebRTC Application – Programming from scratch 

  • Part 1 – How to Create a Simple App Like A Pro 
  • Part 2 – Create a server with Node.js for the App
  • Part 3 – Design your first WebRTC App

Conclusion

With this post , You understand about the next API of webRTC . Now we covered all of the webRTC API’s . Next post onwards , we will start to build some sample webRTC application and let us look these API’s programatically in browser .

If you have any feedback or tips , We are really happy to hear them . See you again !!

Recommended Posts

Default ThumbnailIntroduction of WebRTC technology in Modern browsers Default ThumbnailWebRTC – Access user media with getUserMedia API Default ThumbnailWebRTC – Walk through RTCPeerConnection API
Previous: WebRTC – Walk through RTCPeerConnection API
Next: WebRTC – signaling process and it’s importance in communication

About the Author

Vinay KP is the founder of Engineering Semester blog . He is currently working as a software engineer . He is a very passionate blogger with Interest in research oriented technical articles .

You can contact via

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Latest post

  • WebRTC programming Part 3 – Design your first WebRTC App
  • WebRTC programming Part 2 – Create a server with Node.js for the App
  • WebRTC programming Part 1 – How to Create a Simple App Like A Pro
  • Why you need a signaling server in WebRTC application – You can think it
  • what is adaptive streaming and how it works on video player ?

Footer

About Admin

Welcome to Engineering Semester. I'm Vinay KP. founder and brain behind of this blog. You can feel free to contact me via





Categories

  • application server (4)
  • HTML5 (1)
  • Javascript (1)
  • kinect (1)
  • linux (2)
  • microsoft (1)
  • networking (12)
  • NodeJS (1)
  • streaming (3)
  • web technology (4)
  • webRTC (12)
  • windows (1)
Home | Contact us
Copyright © 2025 engineeringsemester