Menu
Amazon AppStream
Developer Guide

This documentation is for an older version of Amazon AppStream. For information about the latest version, see the Amazon AppStream 2.0 Developer Guide.

Terminating Your Client

The client can end the session with the application in the following ways:

  • End the session and then confirm the session ended.

  • End the session without regard as to when the session ends.

To end the session and then confirm the session ended, first call the XStxClientStop function. This is a non-blocking function call that immediately returns a result. If the call was successful, then call the XStxClientWait function to wait until the session actually ends. When the XStxClientWait call is successful, call the XStxClientRecycle function to recycle the client handle.

To end the session without regard as to when the session ends, call the XStxClientRecycle function. The session then ends without further interaction from the client.

The following excerpt from the example client in the Amazon AppStream SDK illustrates this step. The excerpt is from the windowClosed function in XStxExampleClient.cpp.

Copy
/** Clean up */ void windowClosed() { // the window was closed, do what I need if (!mClientHandle) { return; } // ensure the audio stopped pulling mAudioModule.stop(); XStxClientRecycle(mClientHandle); mClientHandle = NULL; }