0

I would to use com.sun.net.httpserver.HttpServer to do comet/cometd. I am wondering how tough it is to do it so that I can take the waiting connections off the thread and into some waiting queue.

Also, am I correct in that it looks like it is using nio?

Also, is there any better examples? I always get caught up in the terminology that the javadoc uses...

Thanks :)

skaffman
  • 398,947
  • 96
  • 818
  • 769
Paul
  • 316
  • 2
  • 12
  • I expect it has to do with the relationship between the Executor and Exchange. Could the Executor be set up to put the Exchanges on a queue and then have a separate thread pool that picks them up and executes them, plus a mechanism to allow the executor to put itself back on the queue (There would be a separate thing, one it gets an answer that could find it on the queue and give it back to the executor?) – Paul Mar 28 '10 at 16:23

1 Answers1

0

After going in and looking at the source (See, Open Source is a good thing :) ), I can see that there really isn't a way to take the pending response off the thread. Because it has a filter chain, there really isn't a mechanism for it to leave cleanly and then come back to it. I would either need to remove the filter chain, split filters into two pieces, or require them to manage state so that it can leave and come back....

I think for now by task is small enough that I can just let them sit on the stack. So my search for a simple, clean implement ion continues...

Paul
  • 316
  • 2
  • 12