Skip to main content
Version: 5.9.6

IsChatConnect

public bool IsChatConnect(ChannelType channelType);

Parameter

ValueTypeDescription
channelTypeChannelType(enum)Channel type to be checked. ChannelType.Public(normal) or ChannelType.Guild(guild)

Description

Checks whether a socket connection is established between the client and the server.

  • This function is simply to check whether the server and socket are connected. It is not a method to check if the connection has been made normally by sending a request to the chat server.
  • This method simply checks the socket connection status.

Example

bool isConnect = Backend.Chat.IsChatConnect(ChannelType.Public);

// When the chat server and client are connected
// isConnect = true

// When the chat server and client are not connected
// isConnect = false

if(isConnect)
{
Debug.Log("Connected to general channel");
}

Response Cases

ReturnValue(bool)Description
trueWhen the chat server and client are connected
falseWhen the chat server and client are not connected