Click or drag to resize

LogoutRequest Class

Logs the user out of the current server Zone.
Inheritance Hierarchy
SystemObject
  BaseRequest
    Sfs2X.RequestsLogoutRequest

Namespace:  Sfs2X.Requests
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public class LogoutRequest : BaseRequest

The LogoutRequest type exposes the following members.

Constructors
  NameDescription
Public methodLogoutRequest
Creates a new LogoutRequest instance.
Top
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:
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!");         // UWP
}
See Also