Disconnect Method  
 

Terminate the connection with a server.

Syntax

object.Disconnect

Parameters

None.

Return Value

A value of True is returned if the method succeeds. If the method fails, it will return False and the LastError property will contain the error code.

Remarks

The Disconnect method closes the active connection and releases all memory and resources associated with the specified client session. This includes the conversation history, cached message and response data, provider information and any other state maintained by the control. To preserve information from the session, retrieve it before calling this method.

Avoid calling this method while a blocking request is in progress. If a request must be canceled, call the Cancel method first and wait for the blocking operation to return before disconnecting the client session. The IsBlocked property can tell you if the control is in the middle of processing a blocking operation, such as retrieving the response to a message prompt.

See Also

IsBlocked Property, IsConnected Property, Connect Method, OnDisconnect Event