user2022068
user2022068

Reputation:

Java - list current RMI connections

I have a rmi server and rmi clients that are built using java.rmi.*. Besides the connection is protected by server-side SSL. How can I get list of current connections on server side?

Upvotes: 0

Views: 984

Answers (2)

Dean J
Dean J

Reputation: 40298

If you own the code that makes (or receives) the connections, you can create a Set that you add them to when they connect, and where you remove them from when you disconnect.

Upvotes: 0

user207421
user207421

Reputation: 310850

How can I get list of current connections on server side?

From the point of view of RMI clients and servers there is no such thing as an RMI connection in the first place, so there is certainly no API to deal with them.

You could probably fudge something up via the socket factories but it wouldn't be pretty: you would have to extend both SSLServerSocket and SSLSocket and delegate heavily.

Upvotes: 1

Related Questions