public class DataChannel
extends java.lang.Object
Modifier and Type | Class and 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 and Description |
---|
DataChannel(long nativeDataChannel) |
Modifier and Type | Method and 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.
|
public void registerObserver(DataChannel.Observer observer)
public void unregisterObserver()
public java.lang.String label()
public int id()
public DataChannel.State state()
public long bufferedAmount()
public void close()
public boolean send(DataChannel.Buffer buffer)
public void dispose()
6.4.1