public interface CustomDataChannel
The client can send a message to the cloud application via the send(ByteBuffer)
method, and receive the
reply message from the cloud application via CustomDataChannel.Observer.onMessage(int, ByteBuffer)
.
In terms of implementation, the client sends messages to the UDP port of the cloud machine through the send(ByteBuffer)
method, and the cloud application listens to this port to receive messages from the client. The
cloud application replies a message to the UDP port, and the Cloud Rendering SDK will call back the message to the
client through CustomDataChannel.Observer.onMessage(int, ByteBuffer)
. The associated UDP port identifies a data channel
uniquely.
com.tencent.tcr.sdk.api.TcrSession#createCustomDataChannel(int, Observer)
Modifier and Type | Interface and Description |
---|---|
static interface |
CustomDataChannel.Observer
A class can implement the
Observer interface when it wants to be informed of events
in CustomDataChannel objects. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this data channel.
|
boolean |
send(java.nio.ByteBuffer data)
Send data to the cloud Application.
|