bitcoind -zmqpubhashtx causes empty raw file I call:
bitcoind -zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw
or even call:
bitcoind -zmqpubhashtx=tcp://127.0.0.1:9050 -
zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw
where 9050 is port from bicoin config.
File /tmp/bitcoind.tx.raw is empty i has lenght=0
How can I dump transactions?
I read, this file is websocket and I must subscribe to it:
Client side, then, the ZeroMQ subscriber socket must have the ZMQ_SUBSCRIBE 
option set to one or either of these prefixes (for instance, just hash); 
without doing so will result in no messages arriving. Please see 
contrib/zmq/zmq_sub.py for a working example.&quot;

How can I read it programically?
I try create c++ program from Python sources and https://github.com/plq/zmq.git
include 
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;cstring&gt;

#include &quot;zmq.hpp&quot;

using std::cout;
using std::endl;

void recv_multipart(zmq::socket_t &amp;socket) {
    int64_t more=-1;
    size_t more_size = sizeof (more);
    while(more) {
        zmq::message_t response;
        socket.recv(&amp;response);

        std::string response_str((const char *)response.data(),
                                                             response.size());
        cout &lt;&lt; response_str &lt;&lt; endl;

        socket.getsockopt(ZMQ_RCVMORE, &amp;more, &amp;more_size);
    }
}


int main(int argc, char **argv) {
    zmq::context_t context(1);
    zmq::socket_t socket(context, ZMQ_SUB);
    socket.setsockopt(ZMQ_SUBSCRIBE, &quot;hashblock&quot;);
    socket.setsockopt(ZMQ_SUBSCRIBE, &quot;hashtx&quot;);
    socket.setsockopt(ZMQ_SUBSCRIBE, &quot;rawblock&quot;);
    socket.setsockopt(ZMQ_SUBSCRIBE, &quot;rawtx&quot;);
    //socket.connect(/*argv[2]*/&quot;ipc:///tmp/bitcoind.tx.raw&quot;);
    socket.connect(&quot;tcp://127.0.0.1:28332&quot;);

    size_t arg_len= std::strlen(&quot;Unknown&quot;);
    zmq::message_t message(arg_len);
    std::memcpy(message.data(), &quot;Unknown&quot;, arg_len);
    socket.send(message);        
    recv_multipart(socket);        
    return 0;
}
First ensure, that is 28332 port used: -zmqpubhashtx=tcp://127.0.0.1:28332 bitcoind parameter, next call python zmq_sub.py. This should work