System.out.println("Accepted:\n\tThread:"+Thread.currentThread().getName());
OutputStream out = (socket.getOutputStream());
InputStream in = socket.getInputStream();
byte[] input = new byte[43800];
byte[] outputLine;
XByteBuffer buf = new XByteBuffer(input.length, true);
AckProtocol ack = new AckProtocol();
int length = 0;
while ( (length = in.read(input)) >= 0) {
buf.append(input, 0, length);
if (buf.countPackages() > 0) {
outputLine = ack.processInput(buf,incounter());
out.write(outputLine);
}
}
System.out.println("Finished:\n\tThread:"+Thread.currentThread().getName());