47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/**************************
|
|
* Central-Manager *
|
|
***************************
|
|
* Designed & Developed by *
|
|
* Adrien Marquès *
|
|
* <xdrm-brackets> *
|
|
***************************
|
|
* doowap31@gmail.com *
|
|
**************************/
|
|
#include "lib/header.h"
|
|
|
|
|
|
|
|
/* local dependencies */
|
|
#include "lib/network/tcp/server.h"
|
|
#include "lib/network/udp/server.h"
|
|
#include "lib/network/udp/client.h"
|
|
#include "lib/local/middleware.h"
|
|
#include "lib/local/handler.h"
|
|
|
|
|
|
/* headers */
|
|
void* LISTEN_TCP(void* THREADABLE_ARGS);
|
|
void* LISTEN_UDP(void* THREADABLE_ARGS);
|
|
void* MCAST_PUBLISH(void* THREADABLE_ARGS);
|
|
|
|
|
|
|
|
// VARIABLES THREADS D'ECOUTE TCP/UDP
|
|
static pthread_t listenManagers[4]; // contiendra les THREADS d'écoute
|
|
// 1. Multicast UDP (plane)
|
|
// 2. ListenSock TCP (plane)
|
|
// 3. ListenSock UDP (vterm) Multicast
|
|
// 4. ListenSock UDP (cterm) Multicast
|
|
|
|
// VARIABLES THREADS CONNECTION TCP
|
|
static pthread_t TCPManagers[MAX_TCP_THR]; // contiendra les THREADS TCP
|
|
static int activeTCPManagers[MAX_TCP_THR] = {0}; // contiendra les THREADS TCP actifs
|
|
|
|
// VARIABLES THREADS CONNECTION UDP
|
|
static pthread_t UDPManagers[MAX_UDP_THR]; // contiendra les THREADS UDP
|
|
static int activeUDPManagers[MAX_UDP_THR] = {0}; // contiendra les THREADS UDP actifs
|
|
|
|
|
|
// ENREGISTREMENT DES DONNEES AVIONS
|
|
struct context sgca;
|