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 send(ByteBuffer)
method in fact sends the message to a UDP port of the
cloud machine, which is defined when creating this CustomDataChannel. The cloud application listens to this UDP port
to receive messages from the client. When the cloud application replies a message, the Cloud Rendering SDK will call
back the message to the client application through CustomDataChannel.Observer.onMessage(int, ByteBuffer)
. Note that 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.
|