随笔分类 - 常用库
常用库demo
摘要:前言 本文使用的asio1.76.0从github获取,老版本中有一个很重要的结构叫做io_service,新版本中改成了io_context,下面主要通过c++14下的一个异步的例子分析boost.asio的线程模型,其代码结构比较复杂,时间有限不能分析的很详细,只是做大体结构分析 正文 asio
阅读全文
摘要:#include <iostream> #include <utility> #include <boost/type_index.hpp> using namespace std; using boost::typeindex::type_id_with_cvr; template<typenam
阅读全文
摘要:概览 1.base64和md5都可以通过apr util库完成 2.base64编码通过apr_base64_encode()实现 3.md5编码通过apr_md5()实现 正文 1.安装apr库 2.base64编码 "apr base64官方文档" 编译 ref "apr base64官方文档"
阅读全文
摘要:``` #include /* struct timeval { __time_t tv_sec; Seconds. 秒位部分 __suseconds_t tv_usec; Microseconds. 微秒位部分 }; */ void fn(){ struct timeval now; gettimeofday(&now, NULL); //获取从1970年1月1日到现在的时间 cout<<"当前
阅读全文