velolala / touchosc2midi

a (linux compatible) TouchOSC Midi Bridge written in python
MIT License
111 stars 22 forks source link

Use netifaces to query default route interface #12

Closed velolala closed 7 years ago

velolala commented 7 years ago

Previously we relied on trying to send a packet to a non-routed (per RFC) IP in order to obtain the default route. The netifaces module provides some standard methods to query this statically (and platform independent).

This is an alternative fix for #11 -- @h3xl3r can you try running from this branch?

velolala commented 7 years ago

Ha, talk about missing tests -- I forgot some changes. Please retry.

https://github.com/velolala/touchosc2midi/pull/11#issuecomment-281010705

Why rename anyway? Usually more trouble than it's worth, as proven here :)

Well, at the time of writing the original main_ip method I didn't properly understand what mechanism I relied on. Since I now touched the code, I figured I should go ahead and use a more descriptive name.