Version: 2022.1
언어: 한국어

ChannelService.GetOrCreateChannel

매뉴얼로 전환
public static Action GetOrCreateChannel (string channelName, Action<int,byte[]> handler);

파라미터

channelName The name of the channel to retrieve.
handler The channel handler to register.

반환

Action This action can be invoked to unregister the handler from the channel (see ChannelService.UnregisterMessageHandler).

설명

Gets or creates a new channel.

When you create a channel, the ChannelService listens to connections on it, and routes all messages sent to it. You have to register a handler to process the messages and send them back to other clients."

If a channel with the same name already exists, it appends the handler to its list of handlers. This allows you to log or listen to all messages sent to a specific channel.