Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cn/hloop.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
事件循环和IO多路复用机制介绍

事件循环是`libevent、libev、libuv、libhv`这类网络库里最核心的概念,即在事件循环里处理IO读写事件、定时器事件、自定义事件等各种事件;<br>
IO多路复用即在一个IO线程监听多个fd,如最早期的`select`、后来的`poll`,`linux的epoll`、`windows的iocp`、`bsd的kqueue`、`solaris的port`等,都属于IO多路复用机制。<br>
IO多路复用即在一个IO线程监听多个fd,如最早期的`select`、后来的`poll`,`linux的epoll`、`windows的wepoll/WSAPoll`、`bsd的kqueue`、`solaris的port`等,都属于IO多路复用机制。<br>
非阻塞NIO搭配IO多路复用机制就是高并发的钥匙。<br>
`libhv`下的`event`模块正是封装了多种平台的IO多路复用机制,提供了统一的事件接口,是`libhv`的核心模块。<br>

Expand Down
7 changes: 3 additions & 4 deletions event/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
├── iowatcher.h IO多路复用统一抽象接口
├── select.c EVENT_SELECT实现
├── poll.c EVENT_POLL实现
├── epoll.c EVENT_EPOLL实现 (for OS_LINUX)
├── epoll.c EVENT_EPOLL实现 (for OS_LINUX/OS_WIN with wepoll)
├── wepoll/ Windows epoll兼容实现
├── io_uring.c EVENT_IO_URING实现 (for OS_LINUX, with liburing)
├── iocp.c EVENT_IOCP实现 (for OS_WIN)
├── kqueue.c EVENT_KQUEUE实现(for OS_BSD/OS_MAC)
├── evport.c EVENT_PORT实现 (for OS_SOLARIS)
├── nio.c 非阻塞IO
└── overlapio.c 重叠IO
└── nio.c 非阻塞IO

```
6 changes: 1 addition & 5 deletions event/hevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void hio_ready(hio_t* io) {
io->ready = 1;
io->connected = 0;
io->closed = 0;
io->accept = io->connect = io->connectex = 0;
io->accept = io->connect = 0;
io->recv = io->send = 0;
io->recvfrom = io->sendto = 0;
io->close = 0;
Expand Down Expand Up @@ -146,10 +146,6 @@ void hio_ready(hio_t* io) {
#if defined(EVENT_POLL) || defined(EVENT_KQUEUE)
io->event_index[0] = io->event_index[1] = -1;
#endif
#ifdef EVENT_IOCP
io->hovlp = NULL;
#endif

// io_type
fill_io_type(io);
if (io->io_type & HIO_TYPE_SOCKET) {
Expand Down
5 changes: 0 additions & 5 deletions event/hevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ struct hio_s {
unsigned closed :1;
unsigned accept :1;
unsigned connect :1;
unsigned connectex :1; // for ConnectEx/DisconnectEx
unsigned recv :1;
unsigned send :1;
unsigned recvfrom :1;
Expand Down Expand Up @@ -213,10 +212,6 @@ struct hio_s {
int event_index[2]; // for poll,kqueue
#endif

#ifdef EVENT_IOCP
void* hovlp; // for iocp/overlapio
#endif

#if WITH_RUDP
rudp_t rudp;
#if WITH_KCP
Expand Down
2 changes: 0 additions & 2 deletions event/hloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,6 @@ const char* hio_engine() {
return "epoll";
#elif defined(EVENT_KQUEUE)
return "kqueue";
#elif defined(EVENT_IOCP)
return "iocp";
#elif defined(EVENT_PORT)
return "evport";
#elif defined(EVENT_IO_URING)
Expand Down
2 changes: 0 additions & 2 deletions event/hloop.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ const char* hio_engine() {
return "epoll";
#elif defined(EVENT_KQUEUE)
return "kqueue";
#elif defined(EVENT_IOCP)
return "iocp";
#elif defined(EVENT_PORT)
return "evport";
#elif defined(EVENT_IO_URING)
Expand Down
87 changes: 0 additions & 87 deletions event/iocp.c

This file was deleted.

1 change: 0 additions & 1 deletion event/iowatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
!defined(EVENT_POLL) && \
!defined(EVENT_EPOLL) && \
!defined(EVENT_KQUEUE) && \
!defined(EVENT_IOCP) && \
!defined(EVENT_PORT) && \
!defined(EVENT_IO_URING) && \
!defined(EVENT_NOEVENT)
Expand Down
2 changes: 0 additions & 2 deletions event/nio.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "iowatcher.h"
#ifndef EVENT_IOCP
#include "hevent.h"
#include "hsocket.h"
#include "hssl.h"
Expand Down Expand Up @@ -635,4 +634,3 @@ int hio_close (hio_t* io) {
}
return 0;
}
#endif
Loading
Loading