{"action":"created","issue":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3173","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3173/labels{/name}","comments_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3173/comments","events_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3173/events","html_url":"https://github.com/openframeworks/openFrameworks/pull/3173","id":41180239,"number":3173,"title":"ofxOsc: provide access to an ofxOscSender's local port","user":{"login":"totalgee","id":306082,"avatar_url":"https://avatars.githubusercontent.com/u/306082?v=3","gravatar_id":"","url":"https://api.github.com/users/totalgee","html_url":"https://github.com/totalgee","followers_url":"https://api.github.com/users/totalgee/followers","following_url":"https://api.github.com/users/totalgee/following{/other_user}","gists_url":"https://api.github.com/users/totalgee/gists{/gist_id}","starred_url":"https://api.github.com/users/totalgee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totalgee/subscriptions","organizations_url":"https://api.github.com/users/totalgee/orgs","repos_url":"https://api.github.com/users/totalgee/repos","events_url":"https://api.github.com/users/totalgee/events{/privacy}","received_events_url":"https://api.github.com/users/totalgee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-08-26T14:46:34Z","updated_at":"2015-08-24T09:28:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/pulls/3173","html_url":"https://github.com/openframeworks/openFrameworks/pull/3173","diff_url":"https://github.com/openframeworks/openFrameworks/pull/3173.diff","patch_url":"https://github.com/openframeworks/openFrameworks/pull/3173.patch"},"body":"This was done in response to openframeworks/openFrameworks#2696.  The idea was to give access to an ofxOscSender's local port.  That way, an ofxOscReceiver could be created on the same port, and so all OSC communication could pass through a single port, simplifying client/server coding (a server can simply reply to clients at whatever port it receives their messages from).\r\n\r\nA new method was added: `ofxOscSender:: getLocalPort()`.  Internally, this uses a new method exposed in oscpack: `UdpSocket::LocalEndpointForConnectedRemoteEndpoint()`.  The changes to oscpack were proposed by Ross Bencina, after discussing the issue with him.  Note that some optimization was also done in `UdpSocket::LocalEndpointFor()`, to avoid disconnecting and reconnecting, in the case where the local endpoint is being requested for the (already-connected) target.\r\n\r\nTypical usage (in an oF client using ofxOsc) would be something like this:\r\n\r\n    mSender.setup(\"localhost\", serverPort);\r\n    int localPort = mSender.getLocalPort();\r\n    mRecv.setup(localPort);\r\n"},"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/comments/134108587","html_url":"https://github.com/openframeworks/openFrameworks/pull/3173#issuecomment-134108587","issue_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3173","id":134108587,"user":{"login":"arturoc","id":48240,"avatar_url":"https://avatars.githubusercontent.com/u/48240?v=3","gravatar_id":"","url":"https://api.github.com/users/arturoc","html_url":"https://github.com/arturoc","followers_url":"https://api.github.com/users/arturoc/followers","following_url":"https://api.github.com/users/arturoc/following{/other_user}","gists_url":"https://api.github.com/users/arturoc/gists{/gist_id}","starred_url":"https://api.github.com/users/arturoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturoc/subscriptions","organizations_url":"https://api.github.com/users/arturoc/orgs","repos_url":"https://api.github.com/users/arturoc/repos","events_url":"https://api.github.com/users/arturoc/events{/privacy}","received_events_url":"https://api.github.com/users/arturoc/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T09:28:52Z","updated_at":"2015-08-24T09:28:52Z","body":"i merged latest oscpack a couple of weeks ago, @totalgee if you want to remove your changes to oscpack, i think the rest will merge nicely and we can include it for 0.9 since it's such a simple addition now"}}