I modified the sample code available here for Client and Server My client :
public class Client { public static void main(String[] args) { int n=10000;
Try doing Telnet using command -
telnet [host IP] [port]
Issue may be with firewall blocking port.