30 lines
838 B
C
30 lines
838 B
C
/* ipc.h - UNIX domain socket IPC listener and command processor */
|
|
#ifndef __IPC_H__
|
|
#define __IPC_H__
|
|
|
|
#include <ilib/config.h>
|
|
#include <ilib/subscribers.h>
|
|
#include <ilib/pending.h>
|
|
|
|
typedef struct ipc_server {
|
|
int server_fd;
|
|
char *socket_path;
|
|
subrelay_config_t *cfg;
|
|
subscriber_pool_t *subscribers;
|
|
pending_pool_t *pending;
|
|
} ipc_server_t;
|
|
|
|
/* Initialize non-blocking UNIX domain socket server */
|
|
int ipc_server_init(ipc_server_t *server,
|
|
subrelay_config_t *cfg,
|
|
subscriber_pool_t *subscribers,
|
|
pending_pool_t *pending);
|
|
|
|
/* Non-blocking check for incoming client commands from subrelay-shell */
|
|
int ipc_server_poll(ipc_server_t *server);
|
|
|
|
/* Cleanup socket file and close descriptors */
|
|
void ipc_server_destroy(ipc_server_t *server);
|
|
|
|
#endif /* __IPC_H__ */
|