Package org.webrtc
Class DataChannel
java.lang.Object
org.webrtc.DataChannel
Java wrapper for a C++ DataChannelInterface.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classJava version of C++ DataBuffer.static classJava wrapper for WebIDL RTCDataChannel.static interfaceJava version of C++ DataChannelObserver.static enumKeep in sync with DataChannelInterface::DataState. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturn 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.private voidvoidclose()Close the channel.voiddispose()Dispose of native resources attached to this channel.(package private) longintid()label()private longprivate voidprivate intnativeId()private Stringprivate longnativeRegisterObserver(DataChannel.Observer observer) private booleannativeSend(byte[] data, boolean binary) private DataChannel.Stateprivate voidnativeUnregisterObserver(long observer) voidregisterObserver(DataChannel.Observer observer) Register `observer`, replacing any previously-registered observer.booleansend(DataChannel.Buffer buffer) Send `data` to the remote peer; return success.state()voidUnregister the (only) observer.
-
Field Details
-
nativeDataChannel
private long nativeDataChannel -
nativeObserver
private long nativeObserver
-
-
Constructor Details
-
DataChannel
public DataChannel(long nativeDataChannel)
-
-
Method Details
-
registerObserver
Register `observer`, replacing any previously-registered observer. -
unregisterObserver
public void unregisterObserver()Unregister the (only) observer. -
label
-
id
public int id() -
state
-
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
Send `data` to the remote peer; return success. -
dispose
public void dispose()Dispose of native resources attached to this channel. -
getNativeDataChannel
long getNativeDataChannel() -
checkDataChannelExists
private void checkDataChannelExists() -
nativeRegisterObserver
-
nativeUnregisterObserver
private void nativeUnregisterObserver(long observer) -
nativeLabel
-
nativeId
private int nativeId() -
nativeState
-
nativeBufferedAmount
private long nativeBufferedAmount() -
nativeClose
private void nativeClose() -
nativeSend
private boolean nativeSend(byte[] data, boolean binary)
-