33 lines
794 B
C
33 lines
794 B
C
#pragma once
|
|
#include <pthread.h>
|
|
#include "tcp_conn_handle.h"
|
|
#include "uds_conn_handle.h"
|
|
#include "mq_conn_handle.h"
|
|
#include "shm_conn_handle.h"
|
|
|
|
typedef struct ConnectionResult {
|
|
enum { CONN_NONE, CONN_ERR, CONN_NEW } status;
|
|
union {
|
|
pthread_t tid;
|
|
int error;
|
|
};
|
|
} connection_result_t;
|
|
|
|
typedef union ConnHandlData {
|
|
uds_handl_data_t uds_data;
|
|
mq_handl_data_t mq_data;
|
|
tcp_handl_data_t tcp_data;
|
|
shm_handl_data_t shm_data;
|
|
} conn_handl_data_t;
|
|
|
|
typedef struct ConnectionHandler connection_handler_t;
|
|
typedef struct ConnectionHandler {
|
|
conn_handl_data_t conn_data;
|
|
|
|
int (*init)(connection_handler_t*);
|
|
connection_result_t (*check_conn)(connection_handler_t*);
|
|
void (*cleanup)(connection_handler_t*);
|
|
} connection_handler_t;
|
|
|
|
|