• 大小: 1.17MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-29
  • 语言: C/C++
  • 标签: C++  

资源简介

其实就只是对网络底层的一个封装,将一些回调全部都已经封装好,直接指定相应的回调函数就可以对收到的数据包进行处理。 个人觉得该网络库比较方便的地方就是可以直接将所有自定义及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.xml
     文件        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\xml.hpp
     文件       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_object.hpp
     文件       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\base64.hpp
     目录           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个文件信息

评论

共有 条评论