Hi All,
I use Simple Webserver like this :
Server.connection = new Connection(new
MySocketHandler(PipelineHandlerFactory.getInstance(new
ServerHandler(),100,1000), new BufferedPipelineFactory(256)));
From the code you could see that I am going to have 100 concurrent
Thread to handle requests ... (Am I right?)
I currently running a test which concurrently requested 72 message to
Simple Webserver .. But when I check how many concurrent Thread it
stucks on 10 Concurrent threads although my program that send http
request to the Simple Webserver is reaching 72 concurrent threads.
My ServerHandler is looking like this :
public class ServerHandler implements ProtocolHandler {
static int threadUsed = 0;
public void handle(Request req, Response resp) {
try
{ threadUsed++;
System.out.println("Concurrent Threads = " + threadUsed); //
Max it only prints "Concurrent Threads = 10"
// OTHER CODE
Thread.sleep(//a long time);
// OTHER CODE
} finally
{
threadUsed--;
}
}
}
Thank You,
|