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 a Streaming Application

The XStxServerManagerWait function returns when a client session ends and Amazon AppStream terminates the session. Your application should release the resources allocated to the XStxServerManager and XStxServerLibrary objects.

The following excerpt from the sample streaming application illustrates this step. It is from the runAsAppStreamGame function of XStxExampleServer.cpp. This file is in the <install_dir>\example_src\server\common directory.

exit: XStxResult cleanUpResult = XStxServerManagerRecycle(serverManagerHandle); if (cleanUpResult != XSTX_RESULT_OK) { printf("Failed to recycle ServerManager\n"); } cleanUpResult = XStxServerLibraryRecycle(serverLibraryHandle); if (cleanUpResult != XSTX_RESULT_OK) { printf("Failed to recycle ServerLibrary\n"); } delete serverManagerListener; printf("Exit! %s\n", XStxResultGetName(result)); fflush(stdout); return (result != XSTX_RESULT_OK) ? -1 : 0;