• Post Reply Bookmark Topic Watch Topic
  • New Topic

multi threaded chat using http

 
amit tantia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to develop a chat which is one to one. The problem is it should be get/post based i.e.HTTP based and not socket based. Now, the concept is there are two users. Both have an applet running on their browsers and there is a servlet at the server end. I want to know is there a way through which when one user types a message for another user, the other user who is connected to the servlet using an http protocol comes to know instantly. If any one has attempted this kind of an implementation I would like some inputs regarding how were the thread programmed, how was the identification done etc.
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi amit,
Servlet is inherently Multithreaded. That each request to it will generate a new Thread. So you need not worry about server side threding. But server should maintain a list of users already logged in.
Using that list it can distribute a msg from one user among others.
Hope this will give you some guidelines
Cheeers!
 
amit tantia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am aware of the servlet being multi threaded. I am just wondering about the design of my application. Either I have to do a poll wherein one applet connects to the servlet every 5-10 seconds and gets the information or I have to use some other technique ...I need to know if some other technique exists for an HTTP connection and if so, how can the same be processed.
 
prashant komaragiri
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I tried somewhat similar application in which i used the client pull technique.But i think u can do it by custom events also.
prashant

Originally posted by amit tantia:
I am aware of the servlet being multi threaded. I am just wondering about the design of my application. Either I have to do a poll wherein one applet connects to the servlet every 5-10 seconds and gets the information or I have to use some other technique ...I need to know if some other technique exists for an HTTP connection and if so, how can the same be processed.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!