0
votes

When using epoll in edge-triggered mode, if there is like 2KB of data in a socket and you only read 1KB from it, you won't get another notification for it when you do epoll_wait(). If I wanted to get another notification for the unread data, what would I do? I think removing the fd from the epoll set and then adding it again would work, but is there a better way?

1

1 Answers

2
votes

By its very definition, edge-triggered mode doesn't do what you want. Based on your description, you should be using level-triggered mode instead.

What you are asking is akin to "how can I use fread() to write to a file?" You can't, because it's the wrong thing to use to write to a file.