mutouyun / cpp-ipc

C++ IPC Library: A high-performance inter-process communication using shared memory on Linux/Windows.
Other
1.76k stars 337 forks source link

ipc::channel 最大传输数据大小怎么设置呢 我发超过1k数据 就会接收不完整 #76

Open ckJust opened 2 years ago

ckJust commented 2 years ago

ipc::channel buffer 大小设置

mutouyun commented 2 years ago

你指的是什么buff?

ckJust commented 2 years ago

怎么设置可以接收2K左右数据呢 现在是接收不完整

mutouyun commented 2 years ago

不应该啊,你的发送频率是不是很快?

ckJust commented 2 years ago

也不是,我就发了第一条,请问底层是走哪个呢

------------------ 原始邮件 ------------------ 发件人: "mutouyun/cpp-ipc" @.>; 发送时间: 2022年3月1日(星期二) 上午10:49 @.>; @.**@.>; 主题: Re: [mutouyun/cpp-ipc] ipc::channel 最大传输数据大小怎么设置呢 我发超过1k数据 就会接收不完整 (Issue #76)

不应该啊,你的发送频率是不是很快?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

mutouyun commented 2 years ago

如果只发送一条数据的话,底层会直接开一个用于分配你传递数据块大小一致的定长池,然后从池里直接分配空间。 如果100%重现的话,可以发一下你的send、recv的关键代码么?

ckJust commented 2 years ago

 ipc::channel ipc {"ipc", ipc::sender};  ipc.send(buffer, 0/tm/);  //buffer 大概2k

就定义一个channel 直接发送了

------------------ 原始邮件 ------------------ 发件人: "mutouyun/cpp-ipc" @.>; 发送时间: 2022年3月1日(星期二) 中午11:45 @.>; @.**@.>; 主题: Re: [mutouyun/cpp-ipc] ipc::channel 最大传输数据大小怎么设置呢 我发超过1k数据 就会接收不完整 (Issue #76)

如果只发送一条数据的话,底层会直接开一个用于分配你传递数据块大小一致的定长池,然后从池里直接分配空间。 如果100%重现的话,可以发一下你的send、recv的关键代码么?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

mutouyun commented 2 years ago

你可以尝试调整下超时,别用0。 另外可以在运行环境下尝试下demo里的msg_que,看下会不会有什么问题。

目前ipc的设计是为控制流做的,对于数据流的收发并不是很适合,我正在尝试重构整个项目。