#ifndef SERVER_H #define SERVER_H #define LISTEN_ALL // define to listen on 0.0.0.0, else loopback #define MAX_CLIENTS 100 // how many clients the server can handle /* Details for each client, used by Dispatcher and passed to client threads */ struct client_details { int id, pipe, sockid; }; /* Thread, parses and handles messages */ void *Dispatcher(void*); /* Thread, listens for incoming messages */ void *ClientListener(void*); /* Thread, sends messages to the client */ void *ClientSender(void*); /* Handles a client after its connection */ void service(int); /* Handler for signal() */ void interrupt(int); #endif