TcrSdk-Windows V1.0
Classes | Public Member Functions | List of all members
CustomDataChannel Class Referenceabstract

This interface represents a data channel between the client and the cloud application. More...

#include <custom_data_channel.h>

Classes

class  Observer
 A class can implement the Observer interface when it wants to be informed of events in CustomDataChannel objects. More...
 

Public Member Functions

virtual bool Send (const char *data)=0
 Send data to the cloud Application.
 
virtual void Close ()=0
 Close this data channel.
 

Detailed Description

This interface represents a data channel between the client and the cloud application.

The client can send a message to the cloud application via the {

See also
#send(char*)} method, and receive the reply message from the cloud application via {
Observer::onMessage(int, char*)}.

In terms of implementation, the {

See also
#send(char*)} 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 {
Observer::OnMessage(int, char*)}. Note that the associated UDP port identifies a data channel uniquely.
TcrSession::createCustomDataChannel(int, Observer)

Member Function Documentation

◆ Close()

virtual void Close ( )
pure virtual

Close this data channel.

◆ Send()

virtual bool Send ( const char *  data)
pure virtual

Send data to the cloud Application.

Parameters
dataThe data to be sent, which cannot exceed 1,200 bytes.
Returns
true if success, false otherwise.

The documentation for this class was generated from the following file: