Logs the user out of the current server Zone.

Namespace: Sfs2X.Requests
Assembly: SmartFox2X (in SmartFox2X.dll) Version: 1.7.3.0 (1.7.3)

Syntax

C#
public class LogoutRequest : BaseRequest

Remarks

The user is notified of the logout operation by means of the LOGOUT event. This doesn't shut down the connection, so the user will be able to login again in the same Zone or in a different one right after the confirmation event.

Examples

The following example performs a logout from the current Zone:
 Copy imageCopy
void SomeMethod() {
    sfs.AddEventListener(SFSEvent.LOGOUT, onLogout);
    // Logout
    sfs.Send( new LogoutRequest() );
}
void onLogout(BaseEvent evt) {
    Console.WriteLine("Logout executed!");                          // .Net / Unity
    System.Diagnostics.Debug.WriteLine("Logout executed!");         // Windows Universal
}

Inheritance Hierarchy

System..::..Object
  BaseRequest
    Sfs2X.Requests..::..LogoutRequest

See Also