TsgcWSPClient_PresenceEvents › OnErrorPublishMsg

OnErrorPublishMsg Event

Fires when the server rejects a publication with an error.

Syntax

property OnErrorPublishMsg: TsgcWSPresencePublishMsgErrorEvent;
// TsgcWSPresencePublishMsgErrorEvent = procedure(Connection: TsgcWSConnection; const aError: TsgcWSPresenceError; const aMsg: TsgcWSPresenceMsg; const aChannel: TsgcWSPresenceChannel; const aMember: TsgcWSPresenceMember) of object

Default Value

Remarks

Fires on the publisher when a Publish call fails on the server (for example because the channel does not exist, the sender is not subscribed to it, or a server-side rule denies the message). aError describes the reason, aMsg / aChannel / aMember identify the rejected publication.

Example

procedure TForm1.oPresenceErrorPublishMsg(Connection: TsgcWSConnection;
  const aError: TsgcWSPresenceError; const aMsg: TsgcWSPresenceMsg;
  const aChannel: TsgcWSPresenceChannel; const aMember: TsgcWSPresenceMember);
begin
  Memo1.Lines.Add(Format('Publish rejected (%d): %s',
    [aError.Code, aError.Text]));
end;

Back to Events