#include "os.h"
{
}
void
{
}
int
main ( int argc, char *argv[] )
{
const char *sessionProps[20];
int propIndex = 0;
const char *text_p = "Hello world!";
if ( argc < 5 ) {
printf ( "Usage: HelloWorldWebPub <http://msg_backbone_ip[:port]> <vpn> <client-username> <topic> [web-transport-protocol]\n");
return -1;
}
if ((strncmp(argv[1], "http", 4) != 0) && (strncmp(argv[1], "ws", 2) != 0)){
printf ("%s: support HTTP or WS transport protocols only\n", argv[1]);
printf ( "\t Usage: HelloWorldWebPub <http://msg_backbone_ip[:port]> <vpn> <client-username> <topic> [web-transport-protocol]\n");
return -1;
}
printf (
"solClient_initialize: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf ( "HelloWorldWebPub initializing...\n" );
&context_p, &contextFuncInfo, sizeof ( contextFuncInfo ) );
printf (
"solClient_context_create: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
propIndex = 0;
sessionProps[propIndex++] = argv[1];
sessionProps[propIndex++] = argv[2];
sessionProps[propIndex++] = argv[3];
if (argc > 5) {
sessionProps[propIndex++] = argv[5];
}
sessionProps[propIndex] = NULL;
context_p,
&session_p, &sessionFuncInfo, sizeof ( sessionFuncInfo ) );
printf (
"solClient_session_create: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf (
"solClient_session_connect: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf ( "Connected.\n" );
printf (
"solClient_msg_alloc: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf (
"solClient_msg_setDeliveryMode: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
destination.
dest = argv[4];
printf (
"solClient_msg_setDestination: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf (
"solClient_msg_setBinaryAttachment: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf ( "About to send message '%s' to topic '%s'...\n", (char *)text_p, argv[4] );
printf (
"solClient_session_sendMsg: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
printf ( "Message sent. Exiting.\n" );
printf (
"solClient_msg_free: returnCode %d (expect %d)\n", rc,
SOLCLIENT_OK);
return -1;
}
return 0;
}