• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Non Blocking HttpPost Request / Client-Server communication

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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:

Client - JavaBean



Server - Servlet:



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.

Thank You,

Ken
 
Ken Tokuhamaru
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic