TsgcWSPClient_sgc메서드 › Broadcast

Broadcast Method

연결된 모든 클라이언트에 메시지를 브로드캐스트하며, 선택적으로 채널별로 필터링합니다.

구문

procedure Broadcast(const aText: String; const aChannel: String = ''; const aGuid: String = '');

Parameters

NameType설명
aTextconst String브로드캐스트할 페이로드입니다.
aChannelconst String선택적 채널 필터. 제공되면 해당 채널을 구독한 클라이언트만 메시지를 수신합니다.
aGuidconst String대상 서버 측 sgc 프로토콜 인스턴스의 선택적 Guid. 기본값을 사용하려면 비워 두십시오.

설명

채널의 구독자를 대상으로 하는 Publish와 달리, Broadcast는 선택적 채널 필터와 일치하는 연결된 모든 클라이언트에게 전달됩니다. 수신자는 OnMessage 이벤트를 통해 페이로드를 받습니다.

예제

oProtocol.Broadcast('hello everyone');
oProtocol.Broadcast('channel update', 'news');

메서드로 돌아가기