epoll模型:
调试后 NetHandler初步印象:
回调mainNetEvent中有epoll_wait() 然后遍历enable/ready队列
拿到队列中的vc 调用UnixNetVConnection中的读写io函数、更新函数
最终handle_read()处理读到的数据
accept模型:
NetAccept顾名思义 它调用了accept() 创建vc
NetAccept从哪里来的?从netProcessor中来
netProcessor.accept()中 分配了na 初始化na 调用na成员函数init_accept_loop()
init_accept_loop() 通过eventProcessor酝酿了一个线程 acceptLoopEvent()
线程里调用do_blocking_accept() 里面才是真正的调用了accept()
里面分配一个vc 设置vc回调acceptEvent() 压入eventProcessor外部队列
acceptEvent()中将调用vc->action中的回调函数 并设置回调为mainEvent
有点乱
酝酿线程 得先 分配事件e 延续cont初始化事件e
最后调用e中的thread的start函数 也不用说start中调用了pthread_create()函数