Signaling (previously RTM) SDK v1.5.0 API Reference for Linux (C++)
Public Member Functions | Protected Member Functions | List of all members
agora::rtm::IChannel Class Referenceabstract

#include <IAgoraRtmService.h>

Public Member Functions

virtual int  join ()=0
 
virtual int  leave ()=0
 
virtual int  sendMessage (const IMessage *message)=0
 
virtual int  sendMessage (const IMessage *message, const SendMessageOptions &options)=0
 
virtual const char *  getId () const =0
 
virtual int  getMembers ()=0
 
virtual void  release ()=0
 

Protected Member Functions

virtual  ~IChannel ()
 

Constructor & Destructor Documentation

◆ ~IChannel()

virtual agora::rtm::IChannel::~IChannel ( )
inlineprotectedvirtual

Member Function Documentation

◆ join()

virtual int agora::rtm::IChannel::join ( )
pure virtual

Joins a channel.

Note
You can join a maximum of 20 RTM channels at the same time. When the number of the channels you join exceeds the limit, you receive the JOIN_CHANNEL_ERR_FAILURE error code.

◆ leave()

virtual int agora::rtm::IChannel::leave ( )
pure virtual

Leaves a channel.

  • If this method call succeeds:
    • The local user receives the onLeave callback with the LEAVE_CHANNEL_ERR_OK state.
    • All remote users receive the onMemberLeft callback.
  • If this method call fails, the local user receives the onLeave callback with an error code. See LEAVE_CHANNEL_ERR for the error codes.
    Returns
  • 0: Success.
  • ≠0: Failure. See LEAVE_CHANNEL_ERR for the error codes.

◆ sendMessage() [1/2]

virtual int agora::rtm::IChannel::sendMessage ( const IMessage message )
pure virtual
Deprecated:
Allows a channel member to send a message to all members in the channel.

Agora does not recommend using this method to send a channel message. Use sendMessage instead.

If this method call succeeds:

Note
You can send messages, including peer-to-peer and channel messages, at a maximum frequency of (RTM SDK for Windows C++) 180 calls every three seconds or (RTM SDK for Linux C++) 1500 calls every three seconds.
Parameters
message The message to be sent. See IMessage.
Returns

◆ sendMessage() [2/2]

virtual int agora::rtm::IChannel::sendMessage ( const IMessage message,
const SendMessageOptions options 
)
pure virtual

Allows a channel member to send a message to all members in the channel.

If this method call succeeds:

Note
You can send messages, including peer-to-peer and channel messages, at a maximum frequency of (RTM SDK for Windows C++) 180 calls every three seconds or (RTM SDK for Linux C++) 1500 calls every three seconds.
Parameters
message The message to be sent. See IMessage.
options Options when sending the channel message. See See SendMessageOptions.
Returns

◆ getId()

virtual const char * agora::rtm::IChannel::getId ( ) const
pure virtual

Retrieves the channel ID.

Returns
The channel ID of the channel.

◆ getMembers()

virtual int agora::rtm::IChannel::getMembers ( )
pure virtual

Retrieves a member list of the channel.

The onGetMembers callback returns the result of this method call.

Note
You can call this method at a maximum frequency of five calls every two seconds. This method returns a maximum of 512 members. If the number of channel members exceed 512, the method returns 512 members randomly.
Returns

◆ release()

virtual void agora::rtm::IChannel::release ( )
pure virtual

Releases all resources used by the IChannel instance.