This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FBNS: suggestion on clientID

 
Abha Shah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am a new member to the Java ranch big saloon. I have read various forum discussion on Locking mechanism and it's quite helpful, still not very clear to me.

I have chosen to use RMI.

Based on RMI's thread model and considering some time out limit,
Thread.currentThread() can be used as a clinetID or not?

Waiting for reply.


Thanks,
abha
 
Steven Hoodless
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abha,

Welcome to JavaRanch. RMI makes no guarantees that a thread represents the same client in your server. So the answer to your question
Thread.currentThread() can be used as a clinetID or not?
is no.

There are loads of helpful posts on JavaRanch on this subject. I learnt more here than anywhere else. You maybe need to read a good book like The Sun Certified Java Developer Exam with J2SE 1.4.

My method may not be the best for you but I created a new Data class for each client that connected to the Server. This unique Data class identified the client to me. There are other ways to implement your server.

Best Regards,

Steven
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic