Questions tagged [inetaddress]
227 questions
0
votes
1 answer
How to efficiently return the string basis on current datacenter?
We have machine hostname as -
dbx111.dc1.host.com
dbx112.dc2.host.com
dcx113.dc3.host.com
dcx115.dev.host.com
Here dc1, dc2, dc3 and dev are our datacenter and we will be having only four datacenter as of now. And also it might be possible that…

john
- 11,311
- 40
- 131
- 251
0
votes
1 answer
Android alternative to iNetAddress or get it to use another resolver?
We have a situation in our office where the first DNS resolver found by Android doesn't work over wireless (intentional or not, not sure). I'm doing an app to do whois lookups. I need to translate the whois server to IP using the second resolver…

Tab
- 155
- 9
0
votes
1 answer
InetAddress.getByName () adds / to the ip
I'm having a weird problem. I'm creating a socket and giving it the IP 192.168.43.255. When I use InetAddress.getByName(IP) it adds / to the ip as shown in the log below. Why this is happening ??
here is my code
public class ServerCom extends…

Alaa
- 539
- 3
- 8
- 29
0
votes
1 answer
Java InetAddress Not Reachable
I am using InetAddress and I am getting a false response when trying to reach the server. The server is the current latop. Below is the code:
public static void main(String[] args) {
InetAddress i = InetAddress.getByName("ip address of current…

user3189663
- 211
- 4
- 18
0
votes
1 answer
Amazon EC2 instance Problems with UDP transmission
I have been trying to send an UDP packet from an EC2 instance to itself. I received an exception:
java.net.UnknownHostException: xx.xxx.xxx.xxx: Name or service not known
It was generated from the line:
DatagramPacket packet = new…

Charlie D
- 29
- 8
0
votes
1 answer
Is there an automatic way to determine the netmask from a site-local address?
In Android (or Java, I suppose), it's easy enough to determine whether a given address is site-local:
InetAddress a = InetAddress.getByName (addr_string);
if (a.isSiteLocalAddress())
...
However, each of the three flavors of site-local…

Rich
- 4,157
- 5
- 33
- 45
0
votes
2 answers
InetAddress getHostAddress() method gives different outputs when the laptop is connected to internet and not connected to internet?
InetAddress address= InetAddress.getLocalHost();
System.out.println(address.getHostName()+ "------"+address.getHostAddress());
There are 2 types of Outputs for above codes at 2 different occations.
They are:
1) when internet is connected:…

Samitha Chathuranga
- 1,689
- 5
- 30
- 57
0
votes
1 answer
Java comparing if virtual host name and physical host name are same
In our private network. We have physical host name (x.mycompany.com) and dns resolvable (x1.mycompany.com) virtual host name configured to the actual physical host name.
How in java, I can verify if they both inturn resolve to same?
Virtual host has…

Sandeep Reddy
- 31
- 3
0
votes
1 answer
How to send msg using Socket between two android devices.?
Here is my code
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_server);
serverStatus = (TextView) findViewById(R.id.server_status);
SERVERIP =…

Punit
- 667
- 1
- 7
- 17
0
votes
1 answer
Java InetAddressClass getAllByNAme method
I am new to Java programming ,and there is a topic of networking,and my networking concept are weak,so could any one help me out with these methods
What does getAllByName() method returns,it is written that it returns IP addresses of the host?what…

user3380123
- 703
- 1
- 6
- 14
0
votes
1 answer
Get my address with InetAddress in Android
I have this JAVA code
package com.log.app;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class Adressage {
public static String GetMyAdress() {
InetAddress address;
String HostIP = null;
…

HobbitOfShire
- 2,144
- 5
- 24
- 41
0
votes
1 answer
Android unable to add getByName
I'm trying to add getByName to get the IP address of a hostname and use it in my POST command
the problem is wherever i insert this code it crashes
i tried to insert in doInBackground it also crashes So where should i insert it ??
package…

user1928775
- 355
- 1
- 5
- 15
0
votes
0 answers
InetAddress.getLocalHost() returns null in browser
I wrote an applet which takes the MAC address from the local computer.
It works fine on eclipse but at the moment I try to run it via the browser it does not.
after some debugging i've come to realize that this part returns null on…

Ido Barash
- 4,856
- 11
- 41
- 78
0
votes
1 answer
How do I check if InetAddress was created using a hostname or an IP address?
I would like to know that if an InetAddress object was initialized with a hostname or an IP address at construction. Is there a way to check that in java?

SurenNihalani
- 1,398
- 2
- 15
- 28
0
votes
1 answer
Android How to check URL name or IP is rechable
My code is as follow:
public chkRechable(String hostNameOrIp) {
boolean isRechable = InetAddress.getByName(hostNameOrIp).isReachable(30);
return isRechable;
}
Parameter can be "http://192.168.0.77:8080/ws/api/customer/5" or…

ray
- 4,210
- 8
- 35
- 46