• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!