diff options
author | Brennan Ashton <bashton@brennanashton.com> | 2018-11-02 23:50:49 -0700 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-11-28 00:02:35 +0100 |
commit | b76a95c52f812181605248f1f590a199e2e5d0e3 (patch) | |
tree | 9493ca923d95928a4a662e2c05f6d1c95b426029 /gr-zeromq/lib/req_msg_source_impl.h | |
parent | 0733bc4f788c424264d26c1a1f82d831c91b2c15 (diff) |
gr-zeromq: Add last_endpoint function to zmq source and sink blocks
The main reason for this is is allows you to read back the real
address string in the case that port 0 is used and the OS has
auto-assigned a free port.
Diffstat (limited to 'gr-zeromq/lib/req_msg_source_impl.h')
-rw-r--r-- | gr-zeromq/lib/req_msg_source_impl.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gr-zeromq/lib/req_msg_source_impl.h b/gr-zeromq/lib/req_msg_source_impl.h index 322ce4cf51..61d80104d1 100644 --- a/gr-zeromq/lib/req_msg_source_impl.h +++ b/gr-zeromq/lib/req_msg_source_impl.h @@ -48,6 +48,13 @@ namespace gr { bool start(); bool stop(); + + std::string last_endpoint() override { + size_t addr_len = 256; + char addr[addr_len]; + d_socket->getsockopt(ZMQ_LAST_ENDPOINT, addr, &addr_len); + return std::string(addr, addr_len-1); + } }; } // namespace zeromq |