pub.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #include "precompiled.hpp"
4 #include "pub.hpp"
5 #include "pipe.hpp"
6 #include "err.hpp"
7 #include "msg.hpp"
8 
9 zmq::pub_t::pub_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
10  xpub_t (parent_, tid_, sid_)
11 {
12  options.type = ZMQ_PUB;
13 }
14 
15 zmq::pub_t::~pub_t ()
16 {
17 }
18 
19 void zmq::pub_t::xattach_pipe (pipe_t *pipe_,
20  bool subscribe_to_all_,
21  bool locally_initiated_)
22 {
23  zmq_assert (pipe_);
24 
25  // Don't delay pipe termination as there is no one
26  // to receive the delimiter.
27  pipe_->set_nodelay ();
28 
29  xpub_t::xattach_pipe (pipe_, subscribe_to_all_, locally_initiated_);
30 }
31 
32 int zmq::pub_t::xrecv (class msg_t *)
33 {
34  // Messages cannot be received from PUB socket.
35  errno = ENOTSUP;
36  return -1;
37 }
38 
39 bool zmq::pub_t::xhas_in ()
40 {
41  return false;
42 }
ENOTSUP
#define ENOTSUP
Definition: zmq.h:104
ZMQ_PUB
#define ZMQ_PUB
Definition: zmq.h:259
options
Message * options
Definition: src/google/protobuf/descriptor.cc:3119
precompiled.hpp
zmq_assert
#define zmq_assert(x)
Definition: err.hpp:102
errno
int errno
pub.hpp
pipe.hpp
msg.hpp
err.hpp


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:58