随笔分类 -  多集群管理项目技术验证

摘要:用于消息的生成、发送、接收处理和打印。 测试代码: 阅读全文
posted @ 2017-10-09 15:23 lausaa
摘要:基于boost实现的消息通信Client端,目前仅用于发送消息。 阅读全文
posted @ 2017-10-09 15:18 lausaa
摘要:基于boost实现的消息通信Server端,目前仅用于接收消息并调用消息处理函数。 阅读全文
posted @ 2017-10-09 15:13 lausaa
摘要:用于存储消息内容以及消息内容读写相关函数。 阅读全文
posted @ 2017-10-09 15:10 lausaa
摘要:1 #include 2 3 time_t timestamp = time(NULL); //1506349871 4 5 void ConvertTimestampToString(time_t timestamp, string& timestr) 6 { 7 struct tm *tmp; 8 timestamp += 28800; 9 t... 阅读全文
posted @ 2017-09-25 22:32 lausaa
摘要:字节序格式图: 数据结构: 读写代码: 测试代码: 阅读全文
posted @ 2017-09-25 22:28 lausaa
摘要:文件字节序格式: | member_count(1 Byte) | | member_id(8 Bytes) | node_count(1 Byte) | nodes_id(8*node_count Bytes) |...... 读取结构: 读写代码: 测试代码: 阅读全文
posted @ 2017-09-20 12:33 lausaa
摘要:以二进制文件记录集群资源信息。 文件类: 写文件: 读文件: 阅读全文
posted @ 2017-09-20 00:03 lausaa
摘要:多个集群环境,单个集群的浮动IP具有唯一性,因此将集群的ID以IP地址转成8位16进制的字符表示。 例如192.168.0.1,将被转码成:c0a80001,即将IP地址字符串按点分割成4个10进制整数,然后每个整数转码成2位16进制字符。 代码如下: 阅读全文
posted @ 2017-09-19 09:10 lausaa