MCPcopy Create free account
hub / github.com/acl-dev/acl / send_message

Method send_message

lib_acl_cpp/src/ipc/ipc_client.cpp:221–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221void ipc_client::send_message(int nMsg, const void* data, int dlen)
222{
223 struct MSG_HDR hdr;
224
225 hdr.nMsg = nMsg;
226 hdr.dlen = dlen > 0 ? dlen : 0;
227 hdr.magic = magic_;
228
229 // ������Ϣͷ
230 if (sync_stream_ != NULL) {
231 sync_stream_->write(&hdr, sizeof(hdr));
232 } else if (async_stream_ != NULL) {
233 async_stream_->write(&hdr, sizeof(hdr));
234 } else {
235 acl_assert(0);
236 }
237
238 // ������Ϣ��
239 if (data && dlen > 0) {
240 if (sync_stream_ == NULL) {
241 async_stream_->write(data, dlen);
242 } else if (sync_stream_->write(data, dlen) < 0) {
243 close();
244 }
245 }
246}
247
248void ipc_client::trigger(int nMsg, void* data, int dlen)
249{

Callers 9

on_openMethod · 0.80
on_messageMethod · 0.80
on_messageMethod · 0.80
report_errorMethod · 0.80
reportMethod · 0.80
runMethod · 0.80
runMethod · 0.80
rpc_signalMethod · 0.80
runMethod · 0.80

Calls 2

closeFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected