xbianonpi/xbian-package-upstart-xbmc-bridge — pull request #3 by anaconda (2014-04-11 13:38:44+00:00)
Title: Try both IPv4/6 when connecting to XBMC

Apparently the Gotham nightly (xbmc-package-xbmc-gotham-nightly) only listens on IPv6 if the system has IPv6 configured:
`tcp6 0 0 ::1:9090 :::* LISTEN 4514/xbmc.bin`

By setting the address to `localhost` and using `socket.create_connection` the connection is attempted on both address families.
Also, specifying `SOCK_STREAM` is not necessary, as it's the default on Python 2.7 (*bian default) to 3.4.

Before:
`11/04/2014 01:09:43 Cannot connect to XBMC (127.0.0.1:9090) : [Errno 111] Connection refused`
After:
`11/04/2014 15:24:09 Connected to XBMC (localhost:9090)`