mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-18 19:48:47 +02:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user