/* 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"

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

#define HOST "localhost"
#define PORT 61613
#define UN "arne"
#define PW "topsecret"
#define QNAME "/queue/TestQ"

int main(int argc,char *argv[])
{
   simple_stomp_t ctx;
   char s[1000];
   simple_stomp_debug(0);
   simple_stomp_init(&ctx, HOST, PORT, print); /* authentication not supported */
   while(simple_stomp_read(&ctx, QNAME, s))
   {
       printf("%s\n", s);
   }
   simple_stomp_close(&ctx);
   return 0;
}
