john price wrote:java.lang.StringIndexOutOfBoundsException: String index out of range: 0
In this case you are getting empty
String thats why you are getting StringIndexOutOfBoundsException.
In first case just check whether your firewall is blocking the port you are using.