{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/1347","labels_url":"https://api.github.com/repos/zeromq/libzmq/issues/1347/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/libzmq/issues/1347/comments","events_url":"https://api.github.com/repos/zeromq/libzmq/issues/1347/events","html_url":"https://github.com/zeromq/libzmq/issues/1347","id":57344471,"number":1347,"title":"How to backport the zmq_msg_gets(\"Peer-Address\")?","user":{"login":"metadings","id":1684098,"avatar_url":"https://avatars.githubusercontent.com/u/1684098?v=3","gravatar_id":"","url":"https://api.github.com/users/metadings","html_url":"https://github.com/metadings","followers_url":"https://api.github.com/users/metadings/followers","following_url":"https://api.github.com/users/metadings/following{/other_user}","gists_url":"https://api.github.com/users/metadings/gists{/gist_id}","starred_url":"https://api.github.com/users/metadings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metadings/subscriptions","organizations_url":"https://api.github.com/users/metadings/orgs","repos_url":"https://api.github.com/users/metadings/repos","events_url":"https://api.github.com/users/metadings/events{/privacy}","received_events_url":"https://api.github.com/users/metadings/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-11T17:01:12Z","updated_at":"2015-02-11T17:20:22Z","closed_at":"2015-02-11T17:04:33Z","body":"There is the following code in `libzmq`, which is not in `zeromq4-1`:\r\n\r\n```c\r\n// Compile metadata.\r\ntypedef metadata_t::dict_t properties_t;\r\nproperties_t properties;\r\n\r\n// If we have a peer_address, add it to metadata\r\nif (!peer_address.empty()) {\r\n    properties.insert(std::make_pair(\"Peer-Address\", peer_address));\r\n}\r\n\r\n// Add ZAP properties.\r\nconst properties_t& zap_properties = mechanism->get_zap_properties ();\r\nproperties.insert(zap_properties.begin (), zap_properties.end ());\r\n\r\n// Add ZMTP properties.\r\nconst properties_t& zmtp_properties = mechanism->get_zmtp_properties ();\r\nproperties.insert(zmtp_properties.begin (), zmtp_properties.end ());\r\n```\r\n\r\nHow to backport the Peer-Address to the following code in zeromq4-1?\r\n```c\r\n// Compile metadata.\r\ntypedef metadata_t::dict_t properties_t;\r\nproperties_t properties;\r\nproperties_t::const_iterator it;\r\n\r\n// Add ZAP properties.\r\nconst properties_t& zap_properties = mechanism->get_zap_properties ();\r\nit = zap_properties.begin ();\r\nwhile (it != zap_properties.end ()) {\r\n    properties.insert (properties_t::value_type (it->first, it->second));\r\n    ++it;\r\n}\r\n\r\n// Add ZMTP properties.\r\nconst properties_t& zmtp_properties = mechanism->get_zmtp_properties ();\r\nit = zmtp_properties.begin ();\r\nwhile (it != zmtp_properties.end ()) {\r\n    properties.insert (properties_t::value_type (it->first, it->second));\r\n    ++it;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/comments/73922519","html_url":"https://github.com/zeromq/libzmq/issues/1347#issuecomment-73922519","issue_url":"https://api.github.com/repos/zeromq/libzmq/issues/1347","id":73922519,"user":{"login":"metadings","id":1684098,"avatar_url":"https://avatars.githubusercontent.com/u/1684098?v=3","gravatar_id":"","url":"https://api.github.com/users/metadings","html_url":"https://github.com/metadings","followers_url":"https://api.github.com/users/metadings/followers","following_url":"https://api.github.com/users/metadings/following{/other_user}","gists_url":"https://api.github.com/users/metadings/gists{/gist_id}","starred_url":"https://api.github.com/users/metadings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metadings/subscriptions","organizations_url":"https://api.github.com/users/metadings/orgs","repos_url":"https://api.github.com/users/metadings/repos","events_url":"https://api.github.com/users/metadings/events{/privacy}","received_events_url":"https://api.github.com/users/metadings/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T17:20:22Z","updated_at":"2015-02-11T17:20:22Z","body":"I'm going to compile that immediately."}}