• 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

Simple Chat Program HTTP / Servlets

 
Ranch Hand
Posts: 100
Android Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am writing a simple chatting programming built over HTTP and allows people to chat with each other.

The way i am proposing to build the chat servlet, is that when a user logs into the servlet with a user name and password i return the user id of the person over the response object. I also put the user id of the person along with the response object into a global hashtable. When a person say user_id 1 wishes to chat with a person say user_id 2, i read the global hashtable and obtain the user id 2 response object. On the response object i send the message that user_id 1 wants to send to user_id 2.

Could anyone tell me if this method works, or would they be a better way of achieving the above task. I know off course HTTP is connectionless so how else can we send a response to a user who has not initiated a request.

Kind Regards

 
reply
    Bookmark Topic Watch Topic
  • New Topic