|
19 | 19 |
|
20 | 20 | import java.io.EOFException; |
21 | 21 | import java.io.IOException; |
| 22 | +import java.net.InetAddress; |
22 | 23 | import java.net.SocketException; |
23 | 24 | import java.util.HashMap; |
24 | 25 | import java.util.Map; |
@@ -151,8 +152,8 @@ public void ensureIsOpen() |
151 | 152 | public Map<String, Object> _serverProperties; |
152 | 153 |
|
153 | 154 | /** {@inheritDoc} */ |
154 | | - public String getHost() { |
155 | | - return _frameHandler.getHost(); |
| 155 | + public InetAddress getAddress() { |
| 156 | + return _frameHandler.getAddress(); |
156 | 157 | } |
157 | 158 |
|
158 | 159 | /** {@inheritDoc} */ |
@@ -241,7 +242,7 @@ public void start() |
241 | 242 |
|
242 | 243 | // start the main loop going |
243 | 244 | Thread ml = new MainLoop(); |
244 | | - ml.setName("AMQP Connection " + getHost() + ":" + getPort()); |
| 245 | + ml.setName("AMQP Connection " + getAddress().getHostAddress() + ":" + getPort()); |
245 | 246 | ml.start(); |
246 | 247 |
|
247 | 248 | AMQP.Connection.Start connStart = null; |
@@ -559,7 +560,7 @@ public void handleConnectionClose(Command closeCommand) { |
559 | 560 | _brokerInitiatedShutdown = true; |
560 | 561 | Thread scw = new SocketCloseWait(sse); |
561 | 562 | scw.setName("AMQP Connection Closing Monitor " + |
562 | | - getHost() + ":" + getPort()); |
| 563 | + getAddress().getHostAddress() + ":" + getPort()); |
563 | 564 | scw.start(); |
564 | 565 | } |
565 | 566 |
|
@@ -726,6 +727,6 @@ public void close(int closeCode, |
726 | 727 | } |
727 | 728 |
|
728 | 729 | @Override public String toString() { |
729 | | - return "amqp://" + _factory.getUsername() + "@" + getHost() + ":" + getPort() + _virtualHost; |
| 730 | + return "amqp://" + _factory.getUsername() + "@" + getAddress().getHostAddress() + ":" + getPort() + _virtualHost; |
730 | 731 | } |
731 | 732 | } |
0 commit comments