开发者

Using com.sun.net.httpserver.HttpServer for comet/cometd

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 :)


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜