#include <IAgoraRtmService.h>
◆ ~IChannel()
virtual agora::rtm::IChannel::~IChannel |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ 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.
- If this method call succeeds:
- If this method call fails, the local user receives the onJoinFailure callback. See JOIN_CHANNEL_ERR for the error codes.
- Returns
- 0: Success.
- ≠0: Failure. See JOIN_CHANNEL_ERR for the error codes.
◆ 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]
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
-
- 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.