1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef CLIENT_H #define CLIENT_H #include <netinet/in.h> #define BUFFER_SIZE 512 typedef struct { int socket; struct sockaddr_in address; char username[50]; char room[50]; } client_t; void *handle_client(void *arg); void send_to_client(int sock, const char *msg); void broadcast_message(const char *message, int sender_sock); #endif