Back to product page

Connect method


Connects to the server and tries to authenticate.

Syntax

  • Basic
object.Connect ([Hostname])
The Connect(object,Hostname) syntax has these parts:
objectAn expression evaluating to an object of type wodXMPP
HostnameOptional. A Variant value. Holds Hostname or IP address of the server where wodXMPP should try to connect.

Remarks

Connect method will initiate connection between wodXMPP and the remote server. It can be used only if wodXMPP is not connected with server at the same moment (in other words, if State is set to Disconnected).
If you do not provide Hostname argument, wodXMPP will read it from the JID (in Login property), and send DNS SRV request to your server to determine where is XMPP service located. This will, for example, allow your gmail.com accounts to work with no extra changes.
If connection succeeds, Connected event will be fired and you can start to exchange messages with your contacts. If connection fails, Disconnected event will be fired.

Platforms

Windows