摘要:为什么要windows版本? 因为方便调试跟进 VS的体验真的很不错. 搜索了一段时间才发现GITHUB有windows版本的leveldb 但是使用VS编译也有不少坑 可以下载网络上的其他朋友的版本 也可以新建VS空工程导入代码 git地址 https://github.com/google/le
        
阅读全文
 
        
     
    
        
        
摘要:zt http://www.cnblogs.com/captainl1993/p/4788236.html zt http://www.cnblogs.com/captainl1993/p/4788236.html 1、数据服务器详细设计 数据服务器在设计上采用三个层次的数据同步,实现玩家数据的高速
        
阅读全文
 
        
     
    
        
        
摘要:1 使用boost asio网络库 可参照boost asio的文档示例 (异步 同步) 可参考 boost asio 一个聊天的基本框架 asio的网络通讯代码练手 2 使用智能指针 bind function 简化编程 提升效率 参考本博客其他文章 可参考虚函数与bind 实现设计模式的练习 c
        
阅读全文
 
        
     
    
        
        
摘要:相同模式使用虚函数与bind function进行实现对比 1 #include "stdafx.h" 2 #include <iostream> 3 #include <functional> 4 #include <windows.h> 5 6 class Calculater { 7 publ
        
阅读全文
 
        
     
    
        
        
摘要:socket连接中需要判断超时 所以这几天看了看boost中计时器的文档和示例 一共有五个例子 从简单的同步等待到异步调用超时处理 先看第一个例子 1 // timer1.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include <ios
        
阅读全文
 
        
     
    
        
        
摘要:1 使用protobuf 2.x 下载地址(3.x 在c++11 vs2017下报错) 源码 https://github.com/google/protobuf 或者直接下载 二进制文件 2 如果下载的是代码 编译需要使用cmake 来生成VC的工程 cmake的使用从略 编译设置如图 3 如果下
        
阅读全文
 
        
     
    
        
        
摘要:asio的网络基本模板(单例模式 消息队列 ) 1 // MyAsio.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include <iostream> 6 #include <assert.h> 7 #include "NetMgr.h"
        
阅读全文