-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have a const ref to the message in socket::send? #212
Comments
For a successful send we actually swap out the message object so that code, the reasoning behind this, assuming my memory serves, is twofold; First off, and most importantly the underlying libzmq can modify the sent frame, mostly due to the way it allows zero copy processing. This leaves us with a potentially invalid message structure. Secondly a lot of code does a loop around the a poller and receives then sends using the same object, by returning a 'new' empty message we allow an easier time for users. Obviously we wouldn't do this if we didn't have an invalid message in the first place, but as we do we take advantage of it. Sorry its taken me so long to reply, I really need to allocate more time to maintaining this project. See: https://github.com/zeromq/zmqpp/blob/develop/src/zmqpp/socket.cpp#L205 for the swap code |
I'm not very experienced with 0mq, so correct me if I'm wrong, but it seems like socket::send(message&) doesn't modify the message at all? If no, shouldn't the signature be socket::send(const message& )?
The text was updated successfully, but these errors were encountered: