-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Problem: zmq_msg_send doc incorrect for large messages. #2488
Comments
The documentation should be fixed I think, the problem if I remember correctly is that the value would just be truncated if higher than INT_MAX given the API returns an int. |
…urn value is MAX_INT and if more than this number of bytes are to be sent the function will not return the actual number of bytes. This is related to issue zeromq#2488.
…eromq#2488) Solution: Add more information to the doc specifying that MAX_INT is the maximum possible return value.
Fixed by #3266 |
…eromq#2488) Solution: Add more information to the doc specifying that MAX_INT is the maximum possible return value.
…eromq#2488) Solution: Add more information to the doc specifying that MAX_INT is the maximum possible return value.
Actually, I just tried to send more than 2gb of data and hit the assertion in zmq.hpp that checks whether the return value from zmq_msg_recv matches the size of the message received. |
Documentation for zmq_msg_send states:
"Return value
The zmq_msg_send() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below."
However due to the implementation:
the documentation is incorrect for any message of size that exceeds
INT_MAX
. Either the documentation should be changed to indicate that the return is set toINT_MAX
in the case of success for such messages, or the implementation should be changed to limit message size accordingly. Otherwise behavior in these cases is ambiguous to the API caller.The text was updated successfully, but these errors were encountered: