cpp-ipc
cpp-ipc copied to clipboard
C++ IPC Library: A high-performance inter-process communication using shared memory on Linux/Windows.
有时候进程会异常退出,导致pub端一直打印“fail: send, que->ready_sending() == false”。 请问如何在pub端启动的时候,清除所有状态。我记得你之前说加过一个接口,请问我自己实现的话,该如何办? 目前只能` rm -rf /dev/shm/__IPC_SHM__* `这样了。
英文应该是写错了吧,是单写多读
```c++ #include #include #include #include #include #include "libipc/ipc.h" using msg_line = ipc::chan; class shared_memory_register{ public: shared_memory_register(){ }; ~shared_memory_register(){ for(auto iter=shared_memory_dict.begin(); iter!=shared_memory_dict.end(); iter++){ iter->second->send(ipc::buff_t('\0')); iter->second->disconnect(); } }; bool add_shared_memory(const std::string& name){...
```cpp template struct hash { std::size_t operator()(string const &val) const noexcept { return std::hash{}(val.c_str()); } }; ``` 这里边自定义的hash对于string为key时用的是字符串的地址值作为散列函数的输入,正常来说不是应该按照string的内容来散列的吗?这么设计是有什么考虑吗?
功能咨询
作者,你好,这个库能够实现消息监听机制嘛
看到rw_lock和spin_lock好像可以直接放到共享内存shm中,用来同步不同进程的访问。 比较担心不同进程(32位/64位)中rw_lock和spin_lock 的结构体对齐/布局不一致,以及版本兼容问题。 希望可以提供例子,或者更多文档描述。
这似乎不是完全零复制的库,似乎是消息复制到内存,再传递的,这样延迟不够呀 亲爱的,是这样吗? 还是由只进程间传递共享内存地址的 完全无复制的模式???
您好, 最近有個專案需要高效能的 IPC 於是嘗試了一下這個庫,感覺相當不錯! 但目前有個問題,就是他經常會報錯 `fail: send, there is no receiver on this connection.`,但我看起來資料是有正確被接收到的,想請問有什麼原因可能造成這個問題? 另外想請問一下,傳送 struct / class 最好的方式是什麼?目前是用以下的 code,但我的理解是這樣其實是需要一次 copy 的?是否有辦法做到 zero copy? ```c++ // sender while(1) { //...
“ipc::route supports single read and multiple write. ” 应该是单写,多读?
xmake支持用zig交叉编译c++项目,其他依赖没问题,但是到cpp-ipc的时候报错如下 看报错和之前的issue类似 https://github.com/mutouyun/cpp-ipc/issues/55 zig交叉编译就是用clang编译,然后链接对应的libc,这里是指定mingw x86_64,理论上应该是没问题的 ``` PS C:\Users\Administrator\temp\testcppipc> x f --toolchain=zig -v -D -c -p mingw -a x86_64 checking for zig ... ok checking for git ... ok checkinfo: BusyBox...