MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system
Opens a connection.
Call Connect to establish a connection to the server.
Connect sends command to the server, waits for an answer, then implicitly calls Logon in case UserID is defined (not equal to MSG_INVALID_USER_ID default value). In case it is not logged in, it set UserID to MSG_INVALID_USER_ID then raises an appropriate exception, otherwise it set Logged to True. Connect receives contacts list of this client if it is logged successfully. Connect sets the Connected property to True if it is connected successfully. You can check Connected property to learn does this client has opened connection(s) or not.
If your user is registered on the server, you should specify UserID property before calling Connect. In other case, you must set UserID to MSG_INVALID_USER_ID before calling Connect then call RegisterNewUser to obtain valid UserID.
If direct connection and messaging is allowed by AllowDirectly property, the client will be prepared to establish direct connections with another user. To forbid direct messaging, you can set AllowDirectly to False before calling Connect or set Active to False after Connect finished.