I have a question regarding the parallel processing of Http Post requests. In my architecture (Client-Server), I want to communicate with the server over HTTP Post Request/Repsonse. The communication works fine so far, however I have noticed that requests are being processed one-by-one (not parallel), in the opposite way from what I have known from the general Http Request behavior. Following is the code of Client and Server:
When I make multiple requests with my Client, the Servlet process' the requests one-by-one. I can imagine that by nature the communication (InputStream/OutputStream) is blocking, but shouldn't each request to the Servlet create a new Thread, which handle the Http Post request ? Can someone show me the way how I can implement the code in a non-blocking//parallel way ? I would like to know how Browsers implement such things.
Joined: Jul 06, 2009
Seems like I made a mistake requesting the Http Server. I have sent multiple requests to the server via a Webservice, which I invoked multiple times, this caused the Webservice to block. I have enclosed the requesting code into a Thread, and sent multiple requests via parallel Threads, to which the Servlet responded fine. Mystery solved, the error was on my side.