Results 1 to 16 of 16
Thread: java RMI and synchronization
- 07-02-2011, 07:36 AM #1
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-02-2011, 09:14 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
- 07-02-2011, 12:18 PM #3
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-02-2011, 12:23 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-02-2011, 12:53 PM #5
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-02-2011, 01:44 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-02-2011, 04:07 PM #7
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
if my remote object has a login(), logout() and a doWork() method and I want each client to login first before they are allowed to invoke doWork, how do I go about implementing such with multiple clients? since one client can login and another client can piggyback on the first client login to doWork, how can I prevent that?
- 07-02-2011, 04:46 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Your clients need to identify themselves, just as is done in those Servlets, otherwise your remote side can't tell the difference between clients. Given that client identification you can work yourself up from there. Think of RMI as Java's version of RPC.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-02-2011, 05:03 PM #9
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-02-2011, 05:22 PM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
There are different scenarios:
1) the clients make up an id;
2) the server hands out an id after successful login.
the problem with 1) is that two ids might not be unique; the disadvantage with 2) is that the server needs to keep track of the ids already handed out.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-02-2011, 05:26 PM #11
Senior Member
- Join Date
- Nov 2010
- Posts
- 150
- Rep Power
- 3
Is this really a "New to Java" question? If it is, I need to do a lot of work!
- 07-02-2011, 05:32 PM #12
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
It's not really that difficult (read the RMI tutorial) but the op wants to have a notion of logged in clients and clients just 'passing by'; that complicates stuff a bit because RMI is almost the same as remote procedure calling, i.e. it doesn't offer any 'protection', it trusts anything that manages to connect to 'the other side of the wire'.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-02-2011, 05:32 PM #13
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
- 07-02-2011, 05:54 PM #14
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-04-2011, 04:08 AM #15
Member
- Join Date
- May 2011
- Posts
- 47
- Rep Power
- 0
Let's say I hand out the IDs from the server end, what is to stop a client from spoofing their own ID?
- 07-05-2011, 12:28 AM #16
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
Track what ID's you've given out, so clients can only spoof ID's that are in use. You also probably want to generate random strings as the IDs. Even with something like 12 characters, it's incredibly difficult to generate one that's in use. 62^12 is a really big number, and that's just with alphanumeric characters.
If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
Similar Threads
-
Thread synchronization
By rajanis in forum Threads and SynchronizationReplies: 3Last Post: 02-18-2011, 12:30 PM -
Thread synchronization
By rajanis in forum Threads and SynchronizationReplies: 0Last Post: 01-07-2011, 07:38 AM -
Need clear understanding on Synchronization implementation in java
By pankajsatwal in forum New To JavaReplies: 1Last Post: 05-19-2010, 07:45 AM -
Threads and Synchronization
By ASADUN in forum Threads and SynchronizationReplies: 4Last Post: 12-18-2009, 07:00 AM -
Animation Synchronization
By dreadrocksean in forum Advanced JavaReplies: 5Last Post: 08-08-2008, 02:56 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks