摘要:最简单的kv db 最基本的网络连接 使用STL map存储key value 作为多线程互斥的简单例子。 以后有机会逐步优化添加功能 1增加ASIO 异步通讯 2优化存储空间 传递指针 避免过多的拷贝操作 3优化代码结构 4优化全局锁 操作map时候 锁定部分区域而不是锁全局 。(思路在之前博客有
阅读全文
摘要:学习内容来自以下地址 http://www.cnblogs.com/qicosmos/p/4772486.html github https://github.com/qicosmos/cosmos 有了任务队列 在程序运行之初 就预开启多个执行任务的线程 等待任务队列中传来的元素 对元素进行处理
阅读全文
摘要:学习内容来自一下地址 http://www.cnblogs.com/qicosmos/p/4772486.html github https://github.com/qicosmos/cosmos 主要使用c++11的多线程编程的互斥 同步等功能 编写一个生产消费者队列 用于任务的传递 将任务的接
阅读全文
摘要:1 // 1111.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include <cstdlib> 6 #include <iostream> 7 #include <boost/bind.hpp> 8 #include <boost/as
阅读全文
摘要:redis是高效key-value NOSQL 数据库 代码开源 windows下使用需要使用微软在redis官方上的改进版 地址 https://redis.io/download 寻找windows的版本 https://github.com/MicrosoftArchive/redis 我这里
阅读全文
摘要:一个VC项目中 在网络加密 json解析等方面 加载了多个第三方库和文件 boost cryptpp rapidjson mysql的连接池等等 在使用mysql++的时候 多次报错 LNK 2005 error 。basic_ostream。。。。。。。。。 经过阅读官方网页文档 发现需要将项目运
阅读全文
摘要:多线程互斥同步 生产消费者队列 json xml解析生成 template shared_ptr shared_from_this 网络库 死锁调试 加密库 基本的数据结构和算法
阅读全文
摘要:1 // 111111111111.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include <iostream> 6 #include <string> 7 #include <vector> 8 #include <map> 9 10
阅读全文
摘要:博客和书籍资料 来自该地址 https://www.cnblogs.com/qicosmos/category/490693.html 自行编写相应代码进行学习 1 // TimeTest.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #inc
阅读全文
摘要:C++利用Crypto++,vs2005环境下的RSA应用 基于Crypto++/Cryptopp的rsa密钥生成,rsa加密、解密,rsa签名、验签 Keys and Formats 使用Crypto++5.5.2完成RSA加解密,真正的把公钥放在字符串内,而不是放在文件内 C++代码重构——从C
阅读全文
摘要:一个简单的point坐标类 class Point {public: Point():xval(0),yval(0){} Point(int x,int y):xval(x),yval(y){} int x()const { return xval; } int y()const { return
阅读全文
摘要:Vehicle 一个车辆的虚基类 class Vehicle {public: virtual double weight()const = 0; virtual void start() = 0; virtual Vehicle* copy() = 0; virtual ~Vehicle() {}
阅读全文
摘要:示例代码 1 #include "Util.h" 2 #include "MyAsio.h" 3 #include "TcpConnectionManager.h" 4 #include "SocketMessageRecvDispatchManager.h" 5 /* 6 作 者: itdef 7
阅读全文
摘要:资料地址 http://en.cppreference.com/w/cpp/thread/condition_variable/wait_until http://www.cnblogs.com/haippy/p/3252041.html 1 // asdasdwa.cpp: 定义控制台应用程序的入
阅读全文
摘要:本文是学习 boost源码的一些练习 参考文章来自 刘未鹏 C++的罗浮宫(http://blog.csdn.net/pongba) 目录 http://blog.csdn.net/pongba/article/category/37521 检测内嵌类型 检测一个类中是否存在指定的类型 那么只需要利
阅读全文
摘要:#pragma once #include "Util.h" #include "rapidjson/writer.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/document.h" NAMESPACEBEGIN(DEF) //参考 https ://github.com/qicosmos/SmartDB1.03/b...
阅读全文
摘要:先看LockedQueue.h template <class T, typename StorageType = std::deque<T> >class LockedQueue{......} 一个带锁的多线程可安全访问的类,容器默认使用std::deque 常规代码 push进T类型的元素 p
阅读全文
摘要:书接上文 继续分析Socket.h SocketMgr.h template<class T>class Socket : public std::enable_shared_from_this<T> 根据智能指针的使用规则 类中有使用本类自己的指针 必须继承自enable_shared_from_
阅读全文
摘要:trinitycore是游戏服务器的开源代码 许多玩家使用魔兽的数据来进行测试 ,使用它来假设魔兽私服。 官方网址 https://www.trinitycore.org/ 类似的还有mangos 和 kbengine 不过mangos使用庞大的ACE网络框架 kbengine使用自写网络库 两者均
阅读全文