metinkale38
metinkale38

Reputation: 738

Java RMI - Pass Remotes through multiple Clients

i have following scenario: i have one Host with an exported interface and multiple clients, also with exported interfaces.

The clients connect to the host and send there Remote-Objects to the Host. So far, so good.

But if the Host passes one Clients Remote to another Client as parameter over RMI, what will happen?

Will the Clients communicate directly with each over, or over the Host, which distributed the Clients?

If i want the Clients to communicate directly with each other, do i have to pass an IP and establish all connections independently, or will it also work like above?

Upvotes: 0

Views: 273

Answers (1)

user207421
user207421

Reputation: 310913

Will the Clients communicate directly with each over, or over the Host, which distributed the Clients?

The clients will communicate directly with each other, provided only that the original remote object is addressable and reachable from the client that received its stub: otherwise, fail. The original server is not involved.

If I want the Clients to communicate directly with each other, do i have to pass an IP and establish all connections independently

No.

or will it also work like above?

All the client has to do is acquire a stub, somehow.

Upvotes: 1

Related Questions