摘要: Buffer 类的设计是一种应用层的输入输出缓冲技术。对于 Non-blocking IO 来说,其核心思想是避免阻塞在 read() 或 write() 或其他的 IO 系统调用上,这样就可以最大限度地复用 thread of control,让一个线程能够服务于多个 socket 连接。IO 线 阅读全文
posted @ 2022-10-19 15:20 Leaos 阅读(286) 评论(0) 推荐(0) 编辑
摘要: Endian Endian.h 是一个公共头文件,里面包含了一些网络字节序和主机字节序相互转换的问题。 其中所使用的方法如下: // XX 位主机转网络 uint64_t htobe64(uint64_t data); uint32_t htobe32(uint32_t data); uint16_ 阅读全文
posted @ 2022-10-19 15:14 Leaos 阅读(67) 评论(0) 推荐(0) 编辑