#include <stdio.h>
#include <stdlib.h>
#include "proos.h"

int main (int argc, char *argv[]) {
  if (argc != 3) {
    fprintf(stderr, "ProOS MUTS\nUsage: %s IP Port\n", argv[0]);
    return 1;
  }
  
  if (!proos_connect(argv[1], atoi(argv[2]))) {
    fprintf(stderr, "Connection Problem.\n");
    return 1;
  }
  
  if (!proos_register()) {
    fprintf(stderr, "Registration Problem.\n");
    return 1;
  }
  
  /*
   * Do your stuff here.
   */
  
  if (!proos_unregister()) {
    fprintf(stderr, "Unregistration Problem.\n");
    return 1;
  }
  
  if (!proos_disconnect()) {
    fprintf(stderr, "Disconnect Problem.\n");
    return 1;
  }
  
  return 0;
}