MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system


TMsgClient.SendMessage
TMsgClient
Top 

Sends a custom message.

function SendMessage(ToUserID: Cardinal; const Text: String; Directly: Boolean = True): Integer;
function SendMessage(ToUserID: Cardinal; Buffer: PChar; Size: Integer; Directly: Boolean = True): Integer;
function SendMessage(ToUserID: Cardinal; Stream: TStream; Directly: Boolean = True): Integer;

Description

Call SendMessage to send a custom message to the recipient (user or server).
ToUserID is an identifier of the recipient, i.e. UserID or ServerID.
Text is a text of the message.
Buffer is a binary buffer (can be nil).
Size is a size of the binary buffer (must be >= 0).
Stream is a stream with message data.
Set Directly to False to force the client to send message through the server only. Otherwise, it will try to send message to other client directly.

To receive messages, set one of the following event handlers:
OnReceiveTextMessage
OnReceiveBinaryMessage
OnReceiveStreamMessage



© AidAim Software MsgCommunicator: Delphi Messenger Sdk Instant Messaging Sdk Im Sd