MCPcopy Create free account
hub / github.com/ElementsProject/elements / SendZmqMessage

Method SendZmqMessage

src/zmq/zmqpublishnotifier.cpp:191–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191bool CZMQAbstractPublishNotifier::SendZmqMessage(const char *command, const void* data, size_t size)
192{
193 assert(psocket);
194
195 /* send three parts, command & data & a LE 4byte sequence number */
196 unsigned char msgseq[sizeof(uint32_t)];
197 WriteLE32(msgseq, nSequence);
198 int rc = zmq_send_multipart(psocket, command, strlen(command), data, size, msgseq, (size_t)sizeof(uint32_t), nullptr);
199 if (rc == -1)
200 return false;
201
202 /* increment memory only sequence number after sending */
203 nSequence++;
204
205 return true;
206}
207
208bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)
209{

Callers 1

SendSequenceMsgFunction · 0.80

Calls 2

zmq_send_multipartFunction · 0.85
WriteLE32Function · 0.50

Tested by

no test coverage detected