• Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple request handling in Sockets

 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,


I want to handle multiple request in a socket using java. After accepting one request i have many things to do with that request but simultaneously multiple requests for the same can arrive so how can i handle it?
 
george boddey
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when using the server socket and it accepts a connection, you could extend a thread a pass it the socket for processing.
here is a bit of example code:


ServerThread is a thread you have designed to handle the socket request.

Hope this helps
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a more in-depth tutorial dealing with the concept George is talking about.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!