Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teomulti.c

Connect to multi networks with one call

Connect to and manage some teo-networks in one time (without using threads). The networks are divided by the host port number.

Created on July 23, 2015, 12:05 PM

#include <stdio.h>
#include <stdlib.h>
#include "net_multi.h"
#define TMULTI_VERSION VERSION
#define TEONET_NUM 3
const int TEONET_PORTS[] = { 9301, 9302, 9303 }; // Port numbers
const char *TEONET_NAMES[] = { "TEO-A", "TEO-B", "TEO-C" }; // Hosts names
int main(int argc, char** argv) {
printf("Teomulti " TMULTI_VERSION "\n");
md.argc = argc;
md.argv = argv;
md.event_cb = NULL;
md.networks = NULL;
md.run = 1;
ksnMultiClass *km = ksnMultiInit(&md, NULL);
return (EXIT_SUCCESS);
}