step:
-
make
-
open a terminal: ./server
-
then open another terminal: ./client
-
and write abcdefg in client terminal
-
you will see some output in the server terminal.
switch comment in add_event to see the difference in level triggered and edge triggered.
I have refered: https://blog.csdn.net/hyman_c/article/details/53944949
The code is in the source of 后台开发:核心技术与应用实践 p278
Thank you, enjoy it!