#ifndef _EV_SERVER_H_ #define _EV_SERVER_H_ #include #include #define SERVER_PORT 5432 #define REUSEADDR_ON 1 #define CLIENT_BUFFER_MAX 100*1024 // 100KB #define CLIENT_READ_TIMES_MAX 100 #define CLIENT_MAX 100 // max count of clients connected //#todo not support struct EVClientStub { int id; const uint8_t* recvBuff; const size_t recvBuffSize; uint8_t* sendBuff; size_t sendBuffSize; bool deleteSendBuff; EVClientStub() : id(-1), recvBuff(nullptr), recvBuffSize(0), sendBuff(nullptr), sendBuffSize(0), deleteSendBuff(false) { } }; typedef bool (*evclient_proc_t)(EVClientStub& client); extern evclient_proc_t evclient_proc; int server_main(int argc, char **argv); #endif