{"action":"created","issue":{"url":"https://api.github.com/repos/carllerche/mio/issues/187","labels_url":"https://api.github.com/repos/carllerche/mio/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/carllerche/mio/issues/187/comments","events_url":"https://api.github.com/repos/carllerche/mio/issues/187/events","html_url":"https://github.com/carllerche/mio/issues/187","id":81838923,"number":187,"title":"Allow selecting on which interface to join/leave multicast groups","user":{"login":"sdroege","id":301846,"avatar_url":"https://avatars.githubusercontent.com/u/301846?v=3","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-28T09:07:19Z","updated_at":"2015-05-28T20:53:26Z","closed_at":null,"body":"I see that nix already has the required struct definitions to set the interfaces, but it's currently not used or exposed in the API.\r\n\r\nI would propose to add a Option<String> parameter to the join/leave functions, which can take an interface name. This string could then be converted to a interface index with if_nametoindex().\r\n\r\nReason for exposing this as a string is that it's more convenient to use by applications than an interface index directly.\r\n\r\n\r\n(Note about Windows portability: you can implement if_nametoindex() there with GetAdaptersAddresses())"},"comment":{"url":"https://api.github.com/repos/carllerche/mio/issues/comments/106593668","html_url":"https://github.com/carllerche/mio/issues/187#issuecomment-106593668","issue_url":"https://api.github.com/repos/carllerche/mio/issues/187","id":106593668,"user":{"login":"sdroege","id":301846,"avatar_url":"https://avatars.githubusercontent.com/u/301846?v=3","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T20:53:26Z","updated_at":"2015-05-28T20:53:26Z","body":"@rrichardson The reason is that it's apparently not portable to not set any interface at all if there are multiple. You might join on all interfaces, maybe only on a \"default\" one, or on none at all and instead get an error (the latter happens on Android).\r\n\r\nRegarding if_nametoindex(), it's only available on newer Windows versions. On older versions you can easily reimplement it based on other Windows APIs, I wrote some code for GLib for that some years ago.\r\n\r\n\r\n\r\nFor changing the API or adding a new set of functions, that's for you to decide. I think it would be nicer to change the API now that mio is still young instead of cluttering the API with lots of very similar functions.\r\n\r\nFWIW, GLib has 3 parameters for joining/leaving multicast groups: the multicast group, the interface name and a boolean to select source specific multicast (see Wikipedia)."}}