int EpollTcpServer::init(int port, AbstractTcpHandler *handler, int threadCount) { DECLEAR_TCPSERVER_LOGGER; int ret = 0; if(threadCount <= 0) { LOGGER_WARN("EpollTcpServer::init: threadCount < 0.\n"); return -1; } this->mserverPort = port; this->mtcpHandler = handler; ret = this->createSocket(port); if(ret < 0) { LOGGER_WARN("EpollTcpServer::init: failed to create server socket on port: %1.\n", port); ret = -1; } else { ret = createHandlerThread(threadCount); if(ret < 0) { LOGGER_WARN("EpollTcpServer::init: failed to create handler thread.\n"); ret = -2; } } return ret; }
void test2() { Log("123"); createMessgaeQueue(__FUNCTION__, (void*)callback1); createHandlerThread(__FUNCTION__); sendMessage(__FUNCTION__, 8); }