Added a 3rd argument to the StatsD initializer, a boolean which we use to specify if our host is an IPv6 address or not.
I chose to strictly specify the type since we don't want to resolve the host to determine if it's an v4 or v6 (and trust me, OS X will damage your brain when you get into that.. something about the default /etc/hosts having multiple addresses resolving for localhost, and Ruby choosing ::1 as the default for IPSocket.getaddress('localhost').. what a pain.. ANYWAYS.
Here's a first attempt at enabling it. 🌊
$statsd = Statsd.new '::1', 9125, true
Add optional IPv6 support
Maybe this could be determined by looking at the IP address instead of by a boolean?
We'll need to do a resolve at socket setup time though, if it's a dns name.
I don't see any advantage in trying to do guesswork on something that is already known. Not to mention the additional overhead and possible issues with yet another dependency.
ipaddr and resolv are in the stdlib. if someone passes a dns name, they do not know if it's ipv4 or ipv6, so I have some problems with the premise "something that is already known".
When I have time i'll look into writing an improved patch. Thanks!