AsynchronousSocketChannel read! Read other request
<p>i've an AsynchronousServerSocketChannel (java ) and a simple tcpclient ( c# ) </p>

<pre><code>//////**********SERVER
private AsynchronousServerSocketChannel listener;
public void StartServer() {
            listener = AsynchronousServerSocketChannel.open();
        listener.bind(new InetSocketAddress(9999));
        listener.accept(null,new CompletionHandler&lt;AsynchronousSocketChannel, Void&gt;() {
                    public void completed(final AsynchronousSocketChannel ch, Void att) {

                        try {
                            listener.accept(null, this);
...
                             myhandle(ch)
....

public void myhandle(AsynchronousSocketChannel ch) {

    final ByteBuffer buf = ByteBuffer.allocateDirect(xsize);
        ch.read(Headerbuf,ch,new CompletionHandler&lt;Integer, AsynchronousSocketChannel&gt;() {
                    public void completed(Integer result,AsynchronousSocketChannel attachment) {
CharBuffer charBuffer = decoder.decode(buf);
                                                    String s = charBuffer.toString();
                                                    System.out.println("value:" + s);
</code></pre>

<p>`</p>

<p>So the server handle only the first request!!!!</p>

<p>the c# client is too easy:</p>

<pre><code> private static void Test() {
  clientSocket = new TcpClient();
  clientSocket.Connect("127.0.0.1", 9999);

  for (int i = 0; i &lt; 20; i++)
  {
    string tosend = "Message_" + "_" + new Random(10).Next();
    NetworkStream serverStream1 = clientSocket.GetStream();

    serverStream1 = clientSocket.GetStream();
    outStream1 = System.Text.Encoding.ASCII.GetBytes(tosend);
    serverStream1.Write(outStream1, 0, outStream1.Length);
    serverStream1.Flush();
  }
clientSocket.Close();
</code></pre>

<p>The first request is handled correctly by the server!
Why doesn't the server  handle the others requests?</p>

<p>What's the best way to manage multi request? </p>
