split up application in two different sub-applications
This commit is contained in:
parent
7e91e73327
commit
00fb3a02e3
20 changed files with 441 additions and 210 deletions
38
ipc.h
Normal file
38
ipc.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include "rogue_enemy.h"
|
||||
|
||||
#define MAX_CONNECTED_CLIENTS 8
|
||||
|
||||
typedef struct ipc_strategy_socket {
|
||||
pthread_mutex_t mutex;
|
||||
int clients[MAX_CONNECTED_CLIENTS];
|
||||
} ipc_strategy_socket_t;
|
||||
|
||||
typedef struct ipc_strategy_pipe {
|
||||
|
||||
// this pipe is reserved for reporting in_message_t
|
||||
int in_message_pipe_fd;
|
||||
|
||||
// this messages is reserved for receiving out_message_t
|
||||
int out_message_pipe_fd;
|
||||
|
||||
} ipc_strategy_pipe_t;
|
||||
|
||||
typedef enum ipc_strategy {
|
||||
ipc_unix_pipe,
|
||||
ipc_server_sockets,
|
||||
ipc_client_socket,
|
||||
} ipc_strategy_t;
|
||||
|
||||
typedef struct ipc {
|
||||
ipc_strategy_t type;
|
||||
union {
|
||||
ipc_strategy_pipe_t pipe;
|
||||
ipc_strategy_socket_t ssocket;
|
||||
int socket;
|
||||
} endpoint;
|
||||
|
||||
} ipc_t;
|
||||
|
||||
#define SERVER_PATH "/tmp/server.sock"
|
||||
Loading…
Add table
Add a link
Reference in a new issue