Skip to main content

IsChatConnect

public bool IsChatConnect(ChannelType channelType);

Parameters

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 method simply checks whether the server and socket are connected; it is not a method that sends requests to the server to check that the connection is stable.
  • 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 guild channel");
}

Response Cases

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