資源簡介
其實就只是對網(wǎng)絡(luò)底層的一個封裝,將一些回調(diào)全部都已經(jīng)封裝好,直接指定相應(yīng)的回調(diào)函數(shù)就可以對收到的數(shù)據(jù)包進行處理。
個人覺得該網(wǎng)絡(luò)庫比較方便的地方就是可以直接將所有自定義及C++標(biāo)準(zhǔn)庫容器直接發(fā)送到服務(wù)端,而原始的C函數(shù)發(fā)送時連續(xù)存儲的內(nèi)存。
注意,該庫使用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++圖書信息管理系統(tǒng)
- 下一篇:C++圖像處理幾何校正可運行工程
評論
共有 條評論