| | |
| | | try { |
| | | String myhost = host.replace("http://", ""); |
| | | myhost = myhost.replace("https://", ""); |
| | | InetAddress inetAddressArr = InetAddress.getByName(myhost); |
| | | // InetAddress inetAddressArr = InetAddress.getByName(myhost); |
| | | InetAddress[] inetAddressArrs= InetAddress.getAllByName(myhost); |
| | | if (inetAddressArrs.length==1){ |
| | | message.what = 1; |
| | | message.obj = inetAddressArrs[0].getHostAddress(); |
| | | }else { |
| | | message.what = 2; |
| | | message.obj = inetAddressArrs; |
| | | |
| | | message.what = 1; |
| | | message.obj = inetAddressArr.getHostAddress(); |
| | | } |
| | | handler.sendMessage(message); |
| | | |
| | | |
| | | } catch (UnknownHostException e) { |
| | | e.printStackTrace(); |
| | | message.what = 2; |
| | | message.what = -1; |
| | | handler.sendMessage(message); |
| | | } |
| | | |