A network framework.
-
Use Epoll LT mode.
-
The network I/O are in the same thread.
-
Use thread pool to handle the business request message.
-
Implement timer using hierarchy time wheel.
-
Support master-worker process pattern.
-
Integrate spdlog, jsoncpp and so on.
-
Message = Header + Body
-
Header = BodyLength + MsgCode + Crc32.
Filed | Body Length | Msg Code | CRC32 | Body |
---|---|---|---|---|
Type | uint16 | uint16 | uint32 | byte |
Size | 2 bytes | 2 bytes | 4 bytes | length |
ByteOrder | Little Endian | Little Endian | Little Endian | bytes |
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=debug ..
$ make -j4
$ ./build/src/app/Server
$ cd test
$ go test test/client -run ^TestMessage$ -count=1 -v