use ip address if possible when serializing inet socket transport information

This commit is contained in:
kimchy 2010-05-14 00:23:18 +03:00
parent d964f10bbe
commit f6d4654daa
1 changed files with 1 additions and 0 deletions

View File

@ -70,6 +70,7 @@ public class InetSocketTransportAddress implements TransportAddress {
}
@Override public void writeTo(StreamOutput out) throws IOException {
// prefer host address if possible, better than hostname (for example, on rackspace cloud)
if (address.getAddress() != null) {
if (address.getAddress().getHostAddress() != null) {
out.writeUTF(address.getAddress().getHostAddress());