Expose remote FD via zmq_msg_get(&msg, ZMQ_SRCFD)

This patch allows client applications to retrieve the remote endpoint from a message that originated from a tcp socket
This commit is contained in:
Stefan Radomski
2014-01-06 10:31:42 +01:00
parent 08d897b174
commit f30fb8501e
8 changed files with 53 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ zmq::session_base_t *zmq::session_base_t::create (class io_thread_t *io_thread_,
bool active_, class socket_base_t *socket_, const options_t &options_,
const address_t *addr_)
{
session_base_t *s = NULL;
switch (options_.type) {
case ZMQ_REQ:
@@ -115,6 +116,11 @@ int zmq::session_base_t::pull_msg (msg_t *msg_)
errno = EAGAIN;
return -1;
}
// if (socket != NULL && socket->fd() >= 0) {
// msg_->set_fd(socket->fd());
// }
incomplete_in = msg_->flags () & msg_t::more ? true : false;
return 0;