button-chen / buttonrpc_cpp14 Goto Github PK
View Code? Open in Web Editor NEW几百行代码实现的modern c++ rpc library
几百行代码实现的modern c++ rpc library
vs2019环境,报错Run-Time Check Failure #2 stack around the variable 'val' was corrupted。不知道是什么原因
initializer_list<int>{((getv<Tuple, I>(*this, t)), 0)...};
Serializer.hpp 115行
希望有大佬能讲讲这个用法是什么意思
rpc调用的时候,发现字符串长度最长是uint16_t,大概是64k,能否允许传递更长的字符串,比如10M以内,因为代码有点看不懂,我改了几次无法成功
template<typename T>
inline void Serializer::output_type(T& t)
{
int len = sizeof(T);
char* d = new char[len];
if (!m_iodevice.is_eof()){
memcpy(d, m_iodevice.current(), len);
m_iodevice.offset(len);
byte_orser(d, len);
t = *reinterpret_cast<T*>(&d[0]);
}
delete [] d;
}
if (!m_iodevice.is_eof()){
这里有越界风险,current 没有越界,但 current + size 不保证不会越界;
char *d = new char[len];
有内存泄漏的情况,没有 delete 的时机
有太多次的 memcpy 了,从socket 到 vector,再到这里的 d buffer,然后 copy 到变量 T
请问提供大数据量传输吗
我自己根据demo中传输struct结构数据的方式,修改传输cv::Mat 或std::vector类型的数据,发现是数据是减少,并且不可以用的。可以增加以下几种数据类型的使用吗?
1)cv::Mat (opencv图像库中图像信息存储的变量类型)
2)std::vector,及std::array, std::map等STL 数据类型的传输;
3)自定义存储数据是变长度的带有构造函数的数据类型吗?
非常感谢!!!
当多个客户端访问服务器的时候, 服务器是按照串行的方式来执行的.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.