Not sure if this would work with an ip address. 
http://download.java.net/jdk7/archive/b123/docs/api/java/net/InetSocketAddress.html