@@ -0,0 +1,2087 @@
+import juglr.Box;%0Aimport juglr.BoxParser;%0Aimport juglr.JSonBoxParser;%0Aimport juglr.net.HTTP;%0Aimport juglr.net.HTTPRequestWriter;%0Aimport juglr.net.HTTPResponseReader;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.net.InetSocketAddress;%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.channels.SocketChannel;%0A%0A/**%0A * Flood the HTTPServerExample with requests%0A */%0Apublic class HTTPServerExampleClient %7B%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        InetSocketAddress socketAddress =%0A                   new InetSocketAddress(%22localhost%22, 4567);%0A        for (int i = 1; i %3C 10000; i++) %7B%0A            ByteBuffer buf = ByteBuffer.allocate(1024);%0A            SocketChannel channel = SocketChannel.open(socketAddress);%0A%0A            // Send request%0A            HTTPRequestWriter w = new HTTPRequestWriter(channel, buf);%0A            w.writeMethod(HTTP.Method.POST);%0A            w.writeUri(%22/actor/calc/%22);%0A            w.writeVersion(HTTP.Version.ONE_ZERO);%0A            w.writeHeader(%22User-Agent%22, %22Juglr/0.2%22);%0A            w.startBody();%0A            w.writeBody(%22%7B%5C%22isPrime%5C%22 : %22 + i + %22%7D%22);%0A            w.flush();%0A%0A            // Read response%0A            buf.clear();%0A            HTTPResponseReader r = new HTTPResponseReader(channel, buf);%0A            HTTP.Version v = r.readVersion();%0A            if (v == HTTP.Version.ERROR %7C%7C v == HTTP.Version.UNKNOWN) %7B%0A                throw new IOException(%22Bad protocol version version%22);%0A            %7D%0A            int status = r.readStatus().httpOrdinal();%0A            if (status %3C 200 %7C%7C status %3E= 300) %7B%0A                channel.close();%0A                throw new RuntimeException(%22Bad response code %22 + status);%0A            %7D%0A%0A            byte%5B%5D bbuf = new byte%5B1024%5D;%0A            while (r.readHeaderField(bbuf) %3E 0) %7B%0A                // Ignore headers%0A            %7D%0A%0A            BoxParser parser = new JSonBoxParser();%0A            Box box = parser.parse(new InputStreamReader(r.streamBody()));%0A            System.out.println(%22Response: %22 + box.toString());%0A%0A            w.close();%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Implement a raw sample client hammering the HTTPExampleServer with requests.