#include "os.h"
#include "common.h"
void
{
printf ( "Received event for %s : %s (%s)\n",
(char *)user_p,
break;
printf ( "flowEventCallbackFunc() called - %s; subCode %s, responseCode %d, reason %s\n",
break;
default:
printf ( "flowEventCallbackFunc() called - %s. Unrecognized or deprecated event.\n",
break;
}
}
int
main ( int argc, char *argv[] )
{
struct commonOptions commandOpts;
const char *provProps[20];
int provIndex = 0;
char provQueueName[80];
int propIndex = 0;
const char *flowProps[20];
printf ( "\nactiveFlowIndication.c "
"(Copyright 2009-2024 Solace Corporation. All rights reserved.)\n"
);
initSigHandler ( );
common_initCommandOptions(&commandOpts,
( USER_PARAM_MASK ),
(HOST_PARAM_MASK |
PASS_PARAM_MASK |
LOG_LEVEL_MASK |
USE_GSS_MASK |
ZIP_LEVEL_MASK));
if ( common_parseCommandOptions ( argc, argv, &commandOpts, NULL ) == 0 ) {
exit (1);
}
common_handleError ( rc, "solClient_initialize()" );
goto notInitialized;
}
common_printCCSMPversion ( );
commandOpts.logLevel );
&context_p, &contextFuncInfo,
sizeof ( contextFuncInfo ) ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "solClient_context_create()" );
goto cleanup;
}
if ( ( rc = common_createAndConnectSession ( context_p,
&session_p,
common_messageReceiveCallback,
common_eventCallback, NULL, &commandOpts ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "common_createAndConnectSession()" );
goto cleanup;
}
printf ( "Checking for capability SOLCLIENT_SESSION_CAPABILITY_ENDPOINT_MANAGEMENT..." );
goto sessionConnected;
}
printf ( "OK\n" );
printf ( "Checking for capability SOLCLIENT_SESSION_CAPABILITY_ACTIVE_FLOW_INDICATION..." );
goto sessionConnected;
}
printf ( "OK\n" );
snprintf ( provQueueName, sizeof ( provQueueName ),"sample_ActiveFlowIndication_%llu", usTime % 100000 );
printf ( "Provisioning queue '%s' ...", provQueueName );
provProps[provIndex++] = provQueueName;
provProps[provIndex++] = "100";
provProps[provIndex++] = NULL;
session_p,
if ( errorInfo_p != NULL ) {
"solClient_session_endpointProvision() failed subCode (%d:'%s')",
} else {
"solClient_session_endpointProvision() failed subCode (%d:'%s')",
}
goto sessionConnected;
}
} else {
endpointProvisioned = TRUE;
printf ( "OK\n" );
}
flowProps[propIndex++] = provQueueName;
flowProps[propIndex++] = NULL;
printf ( "Creating flow 1..." );
session_p,
common_handleError ( rc, "solClient_session_createFlow() did not return SOLCLIENT_IN_PROGRESS after session create." );
goto sessionConnected;
}
printf ( "OK.\n" );
sleepInSec ( 1 );
printf ( "Creating flow 2..." );
session_p,
common_handleError ( rc, "solClient_session_createFlow() did not return SOLCLIENT_IN_PROGRESS after session create." );
goto sessionConnected;
}
printf ( "OK.\n" );
sleepInSec ( 1 );
printf("Destroying flow 1.\n");
flow1_p = NULL;
sleepInSec ( 1 );
sessionConnected:
printf ( ".\n" );
if ( endpointProvisioned ) {
if (flow1_p)
{
printf ( "Destroying flow 1.\n" );
}
if (flow2_p)
{
printf ( "Destroying flow 2.\n" );
}
printf ( "Deprovisioning queue.\n" );
session_p,
if ( errorInfo_p != NULL ) {
"solClient_session_endpointDeprovision() failed subCode (%d:'%s')",
}
}
}
common_handleError ( rc, "solClient_session_disconnect()" );
}
cleanup:
common_handleError ( rc, "solClient_cleanup()" );
}
notInitialized:
return 0;
}