folly: AsyncServerSocket::getAddress: prefer IPv6
authorSergey Doroshenko <sdoroshenko@fb.com>
Mon, 5 Jan 2015 19:00:41 +0000 (11:00 -0800)
committerViswanath Sivakumar <viswanath@fb.com>
Tue, 13 Jan 2015 19:01:03 +0000 (11:01 -0800)
commit2302736429850e2c965f750a24ceb9fcc6c0f056
treee53e31ad6b828f746a9f979eee99d65d3864b29d
parent9d0223804c0b12ac620cd9ed213ad6c303d1a2e0
folly: AsyncServerSocket::getAddress: prefer IPv6

Summary:
Can't connect from ipv6-only cluster to ipv4/ipv6 service which uses different ports.

Facebook:
A lot of tests start a service, get its port, and try to connect to 127.0.0.1:port, which breaks
after this diff since the port corresponds to IPv6 address, not IPv4. Fixing this by changing
127.0.0.1 to ::1 in places found by sandcastle.

```
fbconfig servicerouter/aggregator/tests servicerouter/client/cpp/test common/fb303/cpp/test thrift/lib/cpp2/test unicorn/hotswap/test common/client_mgmt thrift/test servicerouter/client/swig/tests unicorn/async/test servicerouter/selection/tests
```

Test Plan:
```
$ ./fastcopy_server --dir . &
$ netstat -atnlp | grep LISTEN | grep fastcopy
tcp        0      0 0.0.0.0:65478               0.0.0.0:*                   LISTEN      9348/./fastcopy_ser
tcp        0      0 :::52793                    :::*                        LISTEN      9348/./fastcopy_ser
```

Reviewed By: philipp@fb.com

Subscribers: trunkagent, vkatich, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, davejwatson, andrewcox, mcduff, hitesh, unicorn-diffs@, alandau, mshneer, folly-diffs@, bmatheny, ps, soren

FB internal diff: D1760372

Tasks: 58688185886688

Signature: t1:1760372:1419992695:e7d254b2b8f730baefc169effa236b8daa9d846d
folly/io/async/AsyncServerSocket.cpp