{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/cppzmq/issues/61","labels_url":"https://api.github.com/repos/zeromq/cppzmq/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/cppzmq/issues/61/comments","events_url":"https://api.github.com/repos/zeromq/cppzmq/issues/61/events","html_url":"https://github.com/zeromq/cppzmq/issues/61","id":117173513,"number":61,"title":"send has ambiguous error/success return","user":{"login":"oblitum","id":1269815,"avatar_url":"https://avatars.githubusercontent.com/u/1269815?v=3","gravatar_id":"","url":"https://api.github.com/users/oblitum","html_url":"https://github.com/oblitum","followers_url":"https://api.github.com/users/oblitum/followers","following_url":"https://api.github.com/users/oblitum/following{/other_user}","gists_url":"https://api.github.com/users/oblitum/gists{/gist_id}","starred_url":"https://api.github.com/users/oblitum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblitum/subscriptions","organizations_url":"https://api.github.com/users/oblitum/orgs","repos_url":"https://api.github.com/users/oblitum/repos","events_url":"https://api.github.com/users/oblitum/events{/privacy}","received_events_url":"https://api.github.com/users/oblitum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-16T17:15:14Z","updated_at":"2015-11-16T17:46:13Z","closed_at":null,"body":"```c++\r\n        inline size_t send (const void *buf_, size_t len_, int flags_ = 0)\r\n        {\r\n            int nbytes = zmq_send (ptr, buf_, len_, flags_);\r\n            if (nbytes >= 0)\r\n                return (size_t) nbytes;\r\n            if (zmq_errno () == EAGAIN)\r\n                return 0;\r\n            throw error_t ();\r\n        }\r\n```\r\n\r\nFor `nbytes == 0` (e.g. for parts with size zero), the return is zero, but it's success. Nonetheless, a zero return is being used to mean EAGAIN."},"comment":{"url":"https://api.github.com/repos/zeromq/cppzmq/issues/comments/157116305","html_url":"https://github.com/zeromq/cppzmq/issues/61#issuecomment-157116305","issue_url":"https://api.github.com/repos/zeromq/cppzmq/issues/61","id":157116305,"user":{"login":"mwpowellhtx","id":1824187,"avatar_url":"https://avatars.githubusercontent.com/u/1824187?v=3","gravatar_id":"","url":"https://api.github.com/users/mwpowellhtx","html_url":"https://github.com/mwpowellhtx","followers_url":"https://api.github.com/users/mwpowellhtx/followers","following_url":"https://api.github.com/users/mwpowellhtx/following{/other_user}","gists_url":"https://api.github.com/users/mwpowellhtx/gists{/gist_id}","starred_url":"https://api.github.com/users/mwpowellhtx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwpowellhtx/subscriptions","organizations_url":"https://api.github.com/users/mwpowellhtx/orgs","repos_url":"https://api.github.com/users/mwpowellhtx/repos","events_url":"https://api.github.com/users/mwpowellhtx/events{/privacy}","received_events_url":"https://api.github.com/users/mwpowellhtx/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T17:46:13Z","updated_at":"2015-11-16T17:46:13Z","body":"Why are you calling send when you know your buffer doesn't have anything to send?"}}