I just wrote the below code and made the lines at the end of the page unique and it seems to work well... a bit ... it throws a error an and drops half the lines ...
Any ideas?
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA eleven before end
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA nine before end
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA seven before end
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA five before end
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA three before end
BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA one before end
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at clientpagetest.Main.main(Main.java:60)
Java Result: 1
CLIENT
SERVER
BufferedReader in;
PrintWriter out;
// establish server socket
ServerSocket s = new ServerSocket(7772);
// wait for client connection
Socket incoming = s.accept( );
in = new BufferedReader
(new InputStreamReader(incoming.getInputStream()));
out = new PrintWriter
(incoming.getOutputStream(), true /* autoFlush */);
String Apage = "BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA eleven before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA ten before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA nine before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA eight before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA seven before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA six before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA five before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA four before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA three before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA two before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA one before end"+"\n"+
"BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA END" ;
out.println(Apage);//Sends page