zsm/include/zmr/zmr.h

21 lines
571 B
C
Raw Normal View History

#ifndef SERVER_H_
#define SERVER_H_
#define MAX_CONNECTION_QUEUE 128 /* for listen() */
#define MAX_EVENTS 64 /* Max events can be returned simulataneouly by epoll */
2024-09-28 00:53:03 +02:00
typedef struct {
int fd; /* File descriptor for client socket */
uint8_t *shared_key;
char username[MAX_NAME]; /* Username of client */
} client_t;
2024-09-28 00:53:03 +02:00
typedef struct {
int epoll_fd; /* epoll instance for each thread */
pthread_t thread; /* POSIX thread */
int num_clients; /* Number of active clients in thread */
client_t clients[MAX_CLIENTS_PER_THREAD]; /* Active clients */
} thread_t;
#endif