Package org.webrtc
Class DataChannel
java.lang.Object
org.webrtc.DataChannel
Java wrapper for a C++ DataChannelInterface.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Java version of C++ DataBuffer.static class
Java wrapper for WebIDL RTCDataChannel.static interface
Java version of C++ DataChannelObserver.static enum
Keep in sync with DataChannelInterface::DataState. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
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.private void
void
close()
Close the channel.void
dispose()
Dispose of native resources attached to this channel.(package private) long
int
id()
label()
private long
private void
private int
nativeId()
private String
private long
nativeRegisterObserver
(DataChannel.Observer observer) private boolean
nativeSend
(byte[] data, boolean binary) private DataChannel.State
private void
nativeUnregisterObserver
(long observer) 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.state()
void
Unregister 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)
-