#include "local.h" #include "utils.h" using namespace std; // to keep message from server char message[BUF_SIZE]; // for debuf mode int DEBUG_MODE = 0; // to store client's sockets list list list_of_clients; // to keep result of different functions int res; // to calculate the execution time of a program clock_t tStart; int main(int argc, char *argv[]) { // *** Define debug mode // any additional parameres on startup // i.e. like './server f' or './server debug' // we will switch to switch to debug mode(very simple anmd useful) if(argc > 1) DEBUG_MODE = 1; if(DEBUG_MODE){ printf("Debug mode is ON!\n"); printf("MAIN: argc = %d\n", argc); for(int i=0; i::iterator it; for(it = list_of_clients.begin(); it != list_of_clients.end() ; it++) close(*it); // print statistics printf("Test passed at: %.2f second(s)\n", (double)(clock() - tStart)/CLOCKS_PER_SEC); printf("Total server connections was: %d\n", EPOLL_SIZE); return 0; }