Connect Method
      
 

Description

Connects to the server and tries to authenticate.


Return Type

None  


Syntax

object.Connect [Hostname]



The Connect Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodXMPP.
Hostname Optional. 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.