• 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

How to maintain a session in Client/Server Environment in java

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,
I faced one question in interview .The question is ,How to maintain a session in Client/Server Environment in java.It means no webserver,simple client/server application.
Please tell me , if any body know this thing.
Regards
Jyotisree
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The session Management should be easily done in a web server ( because of the Servlet API). But if you have to session Management in client/Server environment, where the Java Class is listening in a particular port rather then a web server and a client is a swing client, then things get little messy. One way , we can do session management in this kind of client/server environment is, when a client connects to the server , the server could give a unique ID to the client and the client could pass the ID whenever it is taking to the Server. It is like you are taking care of the Session Management in your program.
I hope this helps. If anyone knows a better way, let me know
 
Jyotisree Dhar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Siva, I am agreed with your reply. In more refined way, one thread can be started at server end to keep track of interval set. For each event on Client, time for the thread would be reset for that perticular Client Id.
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jyotisree,
Thanks for joining JavaRanch.
Unfortunately your name violates our naming policy. Please take a quick look at the rules and edit your profile accordingly.
Thank you!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic