Thread-per-request tcp server
I am just trying to understand how to write a thread-per-request TCP
server in Java. I have already written a thread-per-connection server,
that runs serverSocket.accept() and creates a new thread each time a new
connection comes in.
How could this be modified into a thread-per-request server? I suppose the
incoming connections could be put into some sort of queue, but how would
you know which one has issued a request & is ready for service?
I am suspecting that NIO is necessary here, but not sure.
Thanks.
No comments:
Post a Comment