How many clients attached with a RMIServer
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Harsh_Sharma
Posted On:   Monday, May 13, 2002 11:06 PM

i want to know
"How many clients attached with a RMIServer" through java program
i know through netstat we can do in DOS prompt but i want into java program

Re: How many clients attached with a RMIServer

Posted By:   Jorgen_Nordqvist  
Posted On:   Monday, May 20, 2002 04:45 AM

Harsh,

Pass some kind of user id to your RMI server during your RMI calls and store it in a hash table as the key together with current time as the value. If the user disconnects, and provided you are able to detect such an event, remove entry for that user from the hash table. You need to make the hash table self-cleaning by having a separate thread that times out and removes stale connections.

Total number of active users are now the number of entries in the hash table.

Jorgen

About | Sitemap | Contact