/* Collection of code snippets by Arne Vajhøj */
/* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) */
#include <stdio.h>

#include "simple_stomp.h"

static void print(char *msg)
{
   printf("Error: %s\n", msg);
}

#define HOST "localhost"
#define PORT 61613
#define UN "arne"
#define PW "topsecret"
#define TNAME "/topic/TestT"
#define PAYLOAD "<data>\r\n    <id>123</id>\r\n   <name>ABC</name>\r\n</data>"

int main(int argc,char *argv[])
{
   simple_stomp_t ctx;
   int i;
   simple_stomp_debug(0);
   simple_stomp_init(&ctx, HOST, PORT, print); /* authentication not supported */
   for(i = 0; i < 3; i++)
   {
       simple_stomp_write(&ctx, TNAME, PAYLOAD);
   }
   simple_stomp_close(&ctx);
   return 0;
}
