#include "os.h"
#include "common.h"
void
{
printf ( "Log: Category=%s, Level=%s, Msg=%s\n",
}
int
main ( int argc, char *argv[] )
{
struct commonOptions commandOpts;
char binMsg[1024];
printf ( "\nredirectLogs.c (Copyright 2007-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_log_setCallback()" );
goto notInitialized;
}
common_handleError ( rc, "solClient_initialize()" );
goto notInitialized;
}
common_printCCSMPversion ( );
&context_p, &contextFuncInfo,
sizeof ( contextFuncInfo ) ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "solClient_context_create()" );
goto cleanup;
}
if ( ( rc = common_createAndConnectSession ( context_p,
&session_p,
common_messageReceivePrintMsgCallback,
common_eventCallback, NULL, &commandOpts ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "common_createAndConnectSession()" );
goto cleanup;
}
common_handleError ( rc, "solClient_msg_alloc()" );
goto sessionConnected;
}
common_handleError ( rc, "solClient_msg_setDeliveryMode()" );
goto sessionConnected;
}
memset ( ( void * ) binMsg, 0xab, sizeof ( binMsg ) );
common_handleError ( rc, "solClient_msg_setBinaryAttachmentPtr()" );
goto sessionConnected;
}
destination.
dest = COMMON_MY_SAMPLE_TOPIC;
common_handleError ( rc, "solClient_msg_setDestination()" );
goto sessionConnected;
}
common_handleError ( rc, "solClient_session_send" );
goto sessionConnected;
}
common_handleError ( rc, "solClient_msg_free()" );
goto sessionConnected;
}
sleepInSec ( 2 );
sessionConnected:
common_handleError ( rc, "solClient_session_disconnect()" );
}
cleanup:
common_handleError ( rc, "solClient_cleanup()" );
}
notInitialized:
return 0;
}