资源简介
其实就只是对网络底层的一个封装,将一些回调全部都已经封装好,直接指定相应的回调函数就可以对收到的数据包进行处理。
个人觉得该网络库比较方便的地方就是可以直接将所有自定义及C++标准库容器直接发送到服务端,而原始的C函数发送时连续存储的内存。
注意,该库使用C11编译,所以客户端必须支持C11,压缩包里面有demo。

代码片段和文件信息
/*
Copyright (c) 2014 Randolph Voorhies Shane Grant
All rights reserved.
Redistribution and use in source and binary forms with or without
modification are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of cereal nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS“ AND
ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES AND SHANE GRANT BE LIABLE FOR ANY
DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES
(INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 4244 4267)
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include se_object.hpp>
#include
#include
#include
#include
//! Runs serialization to save data to an ostringstream
/*! Used to time how long it takes to save data to an ostringstream.
Everything that happens within the save function will be timed including
any set-up necessary to perform the serialization.
@param data The data to save
@param saveFunction A function taking in an ostringstream and the data and returning void
@return The ostringstream and the time it took to save the data */
template
std::chrono::nanoseconds
saveData( T const & data std::function saveFunction std::ostringstream & os )
{
auto start = std::chrono::high_resolution_clock::now();
saveFunction( os data );
return std::chrono::duration_cast( std::chrono::high
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-07-29 18:04 libSocket\
目录 0 2015-07-29 18:05 libSocket\include\
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\
文件 469 2015-06-09 02:13 libSocket\include\cereal-1.1.2\.gitignore
文件 1212 2015-06-09 02:13 libSocket\include\cereal-1.1.2\.travis.yml
文件 1158 2015-06-09 02:13 libSocket\include\cereal-1.1.2\CMakeLists.txt
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\doc\
文件 80164 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\doxygen.in
文件 6115 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\DoxygenLayout.xm
文件 1139 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\footer.html
文件 1847 2015-06-09 02:13 libSocket\include\cereal-1.1.2\doc\mainpage.dox
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\
文件 18158 2015-07-17 19:58 libSocket\include\cereal-1.1.2\include\cereal\access.hpp
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\archives\
文件 6034 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\adapters.hpp
文件 6682 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\binary.hpp
文件 39748 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\json.hpp
文件 10813 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\portable_binary.hpp
文件 35871 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\archives\xm
文件 39966 2015-07-20 17:08 libSocket\include\cereal-1.1.2\include\cereal\cereal.hpp
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\details\
文件 13221 2015-07-17 19:58 libSocket\include\cereal-1.1.2\include\cereal\details\helpers.hpp
文件 19156 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\details\polymorphic_impl.hpp
文件 3720 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\details\static_ob
文件 91251 2015-07-17 19:58 libSocket\include\cereal-1.1.2\include\cereal\details\traits.hpp
文件 2931 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\details\util.hpp
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\external\
文件 4035 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\external\ba
目录 0 2015-07-29 18:05 libSocket\include\cereal-1.1.2\include\cereal\external\rapidjson\
文件 28679 2015-06-09 02:13 libSocket\include\cereal-1.1.2\include\cereal\external\rapidjson\document.h
............此处省略152个文件信息
- 上一篇:C++图书信息管理系统
- 下一篇:C++图像处理几何校正可运行工程
相关资源
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
- VC++基于OpenGL模拟的一个3维空间模型
评论
共有 条评论