#include #include #include #include #include #include #include #include #include #include Client *clients[1024] = {}; Buffer scratch("scratch"); void new_connection(int fd) { if (clients[fd]) { delete clients[fd]; } clients[fd] = new Client(scratch, fd); } void existing_connection(int fd) { clients[fd]->parse_message(); } int main() { scratch.read_file("test.txt"); Socket listener; listener.listen(new_connection, existing_connection); }