leopard-c / unixdomainsocket Goto Github PK
View Code? Open in Web Editor NEW同一主机的进程间通信,Client/Server模式。
License: MIT License
同一主机的进程间通信,Client/Server模式。
License: MIT License
i like ur work
void ImplBaseServer::Start() 内部的 struct sockaddr_un client_addr; 变量未进行初始化,存在一定的几率 导致 回调函数的client_addr 参数内部的 sun_path 包含乱码。进而导致服务端的调用的应答信息丢失。
我这边临时的解决方案如下: (每个循环都会清除这个结构体)
`void ImplBaseServer::Start() {
if (!inited_ || !stopped_) {
return;
}
should_stop_ = false;
stopped_ = false;
struct sockaddr_un client_addr;
socklen_t client_addr_length = sizeof(client_addr);
fd_set read_fds;
Packet* packet = nullptr;
while (!should_stop_) {
if (!packet) {
packet = new Packet();
}
memset(&client_addr, 0, sizeof(client_addr));
if (util::recv_data(fd_, &read_fds, packet, &client_addr, &client_addr_length)) {
ProcessRequestPacket(client_addr, packet);
}
}
if (packet) {
delete packet;
packet = nullptr;
}
stopped_ = true;
}`
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.