📄 main.cpp
字号:
#include "utility/thread.h"
#include "iocp/iocomplete.h"
#include "testthread.h"
#include "utility/fixobjpool.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include "cirbuf.h"
//fixObjPool_lockbase<userContext> context_pool;
int main(int argc, char **argv)
{
listener *lw = new listener(std::string("127.0.0.1"),atoi(argv[1]),5);
Thread c(lw);
IocpHandle iocp = CreateIocp(4096);
lw->setTrig(iocp);
c.start();
completeWorker *workerA = new completeWorker(iocp);
completeWorker *workerB = new completeWorker(iocp);
completeWorker *workerC = new completeWorker(iocp);
completeWorker *workerD = new completeWorker(iocp);
Thread twa(workerA);
Thread twb(workerB);
Thread twc(workerC);
Thread twd(workerD);
twa.start();
twb.start();
twc.start();
twd.start();
getchar();
CloseIocp(iocp);
/*cirbuf<> cbuf;
char buf[6];
for(int i = 0; i < 1000; ++i)
{
if(6 != cbuf.put("hello",6))
{
printf("put error\n");
return 0;
}
if(6 != cbuf.get(buf,6))
{
printf("get error\n");
return 0;
}
printf("%s\n",buf);
memset(buf,0,6);
}*/
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -