Get the IP address of our host. Look up the name the first time and remember that we've done so, whether the lookup fails or not.
()
| 494 | * so, whether the lookup fails or not. |
| 495 | */ |
| 496 | private synchronized InetAddress getHostAddress() { |
| 497 | if (hostAddressKnown) |
| 498 | return hostAddress; |
| 499 | if (host == null) |
| 500 | return null; |
| 501 | try { |
| 502 | hostAddress = InetAddress.getByName(host); |
| 503 | } catch (UnknownHostException ex) { |
| 504 | hostAddress = null; |
| 505 | } |
| 506 | hostAddressKnown = true; |
| 507 | return hostAddress; |
| 508 | } |
| 509 | |
| 510 | /** |
| 511 | * The class contains a utility method for converting a |
no test coverage detected