reactor
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Engineering a Reactor -- how to write a non-blocking network library from scratch. Step 0: a do-nothing event loop EventLoop, assertInLoopThread() test1: poll for 10 seconds, creates two threads, each one has an EventLoop test2: abort() as it accesses event loop created in a different thread Step 1: prototype of reactor Channel, Poller, updateChannel(). test1: poll for ever, creates two threads, each one has an EventLoop test2: same as before test3: poll a timerfd, which expires in 5 seconds Step 2: TimerQueue TimerQueue, Timer, TimerId, EventLoop::runAfter, EventLoop::runEvery not thread safe test4: timer queue unittest Step 3: wakeup(), runInLoop(), EventLoopThread test5: runInLoop(), runAfter() in loop thread test6: runInLoop(), runAfter() in a different thread Step 4: Acceptor test7: listen on port 9981, accept, send, and close Step 5: TcpServer, create TcpConnection test8: use of TcpServer, discard server Step 6: TcpConnection passive close Step 7: TcpConnection read with Buffer, add receiveTime to read callback test3: show receiveTime test8: show receiveTime Step 8: TcpConnection write test9: echo server test10: data source server Step 9: write complete callback, tcp no delay, SIGPIPE test11: chargen server Step 10: multithreaded TcpServer, EventLoopThreadPool test8,9,10,11: support multithreads Step 11: Connector, TimerQueue::cancel() test12: Step 12: TcpClient test13: Step 13: epoll, EPoller