1.Create a event_base with IOCP:
2.then call evconnlistener_new_bind(), the listener callback looks like this:
struct bufferevent *bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE);
bufferevent_setcb(bev, conn_readcb, conn_writecb, conn_eventcb, NULL);
bufferevent_enable(bev, EV_WRITE | EV_READ);
3. Connect from a client, nothing will happen, but if you create event_base without IOCP flag, conn_writecb will be called immediatly.
I know the callback mechanism when with IOCP or without IOCP are different, but this hidden difference is an unhappy experience especially when you want to use IOCP to replace select for code that works well. After all, when connection established, a connection should be ready for write.
Log in to post a comment.