Esempio n. 1
0
/*
 * Cleans up and exits the application.
 */
void cleanUpAndExit(int code)
{
	RsslErrorInfo rsslErrorInfo;

	if (pReactor && rsslDestroyReactor(pReactor, &rsslErrorInfo) != RSSL_RET_SUCCESS)
	{
		printf("Error cleaning up reactor: %s\n", rsslErrorInfo.rsslError.text);
		exitApp(-1);
	}

	rsslUninitialize();

	exitApp(code);
}
Esempio n. 2
0
/*
 * Cleans up and exits the application.
 */
void cleanUpAndExit()
{
	RsslErrorInfo error;

	printf("Exiting.\n");

	rsslDestroyReactor(pReactor, &error);

	uninitializeCache();

	rsslUninitialize();
	/* WINDOWS: wait for user to enter something before exiting  */
#ifdef _WIN32
	printf("\nPress Enter or Return key to exit application:");
	getchar();
#endif
	exit(0);
}
Esempio n. 3
0
/*
 * Cleans up and exits the application.
 */
void cleanUpAndExit()
{
	int i;
	RsslErrorInfo rsslErrorInfo;


	if (pReactor)
	{
		/* clean up client sessions */
		for (i = 0; i < MAX_CLIENT_SESSIONS; i++)
		{
			if ((clientSessions[i].clientChannel != NULL) && (clientSessions[i].clientChannel->socketId != -1))
			{
				removeClientSessionForChannel(pReactor, clientSessions[i].clientChannel);
			}
		}

		if (rsslDestroyReactor(pReactor, &rsslErrorInfo) != RSSL_RET_SUCCESS)
			printf("Error cleaning up reactor: %s\n", &rsslErrorInfo.rsslError.text);

		/* clean up server */
		FD_CLR(rsslSrvr->socketId, &readFds);
		FD_CLR(rsslSrvr->socketId, &exceptFds);
		rsslCloseServer(rsslSrvr, &rsslErrorInfo.rsslError);
	}

	uninitializeCache();

	rsslUninitialize();
	/* free memory for dictionary */
	freeDictionary();

	printf("Exiting.\n");

	/* WINDOWS: wait for user to enter something before exiting  */
#ifdef _WIN32
	printf("\nPress Enter or Return key to exit application:");
	getchar();
#endif
	exit(RSSL_RET_FAILURE);
}