Package tvi.webrtc

Class DataChannel


  • public class DataChannel
    extends java.lang.Object
    Java wrapper for a C++ DataChannelInterface.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DataChannel.Buffer
      Java version of C++ DataBuffer.
      static class  DataChannel.Init
      Java wrapper for WebIDL RTCDataChannel.
      static interface  DataChannel.Observer
      Java version of C++ DataChannelObserver.
      static class  DataChannel.State
      Keep in sync with DataChannelInterface::DataState.
    • Constructor Summary

      Constructors 
      Constructor Description
      DataChannel​(long nativeDataChannel)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long bufferedAmount()
      Return the number of bytes of application data (UTF-8 text and binary data) that have been queued using SendBuffer but have not yet been transmitted to the network.
      void close()
      Close the channel.
      void dispose()
      Dispose of native resources attached to this channel.
      int id()  
      java.lang.String label()  
      void registerObserver​(DataChannel.Observer observer)
      Register |observer|, replacing any previously-registered observer.
      boolean send​(DataChannel.Buffer buffer)
      Send |data| to the remote peer; return success.
      DataChannel.State state()  
      void unregisterObserver()
      Unregister the (only) observer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataChannel

        public DataChannel​(long nativeDataChannel)
    • Method Detail

      • registerObserver

        public void registerObserver​(DataChannel.Observer observer)
        Register |observer|, replacing any previously-registered observer.
      • unregisterObserver

        public void unregisterObserver()
        Unregister the (only) observer.
      • label

        public java.lang.String label()
      • id

        public int id()
      • bufferedAmount

        public long bufferedAmount()
        Return the number of bytes of application data (UTF-8 text and binary data) that have been queued using SendBuffer but have not yet been transmitted to the network.
      • close

        public void close()
        Close the channel.
      • send

        public boolean send​(DataChannel.Buffer buffer)
        Send |data| to the remote peer; return success.
      • dispose

        public void dispose()
        Dispose of native resources attached to this channel.