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 DatagramPacket(buf, buf.length, InetAddress.getByName(destination), RPCServer.PORTNUM);
I am sure this exception is from InetAddress.getByName(destination), in which destination is a string of the raw IP address of my EC2 instance. Could anyone tell me how I can get around this exception?