mail::account::logout
Prev | mail::account Native API reference | Next

## Name

mail::account::logout — Disconnect from the server

## Synopsis

#include <libmail/mail.H>
class myCallback : public mail::callback {
public:
void success(std::string msg);
void fail(std::string msg);
};

mail::account *account;

`account->logout(` | myCallback & | callback`)`;

## USAGE

Close the mail account. The application should wait until either `callback.success` or `callback.fail` is called (not much of a difference, really, in both cases the mail::account object disconnects from the server). The `disconnected` method of the mail::callback::disconnect object, originally passed to `mail::account::open`, is also invoked.

## Return Codes

The application must wait until `callback`'s `success` or `fail` method is invoked. The `success` method is invoked when this request is succesfully processed. The `fail` method is invoked if this request cannot be processed. The application must not destroy `callback` until either the `success` or `fail` method is invoked.

### Note

`callback`'s `fail` method may be invoked even after other callback methods were invoked. This indicates that the request was partially completed before the error was encountered.

In this case, however, there is no substantial difference between `success` and `fail`. `mail::account::logout` does not destroy the mail::account object, the object may be destroyed after either callback function is invoked.

Prev | Up | Next
mail::account::isRemoteUrl | Home | ToC | mail::account::moveMessagesTo