Client/server model and avoiding a registry lookup

Sorry if this question has been asked/answered before - I searched the forums and could not find the answer to my quesiton.

I am using RMI to model a fairly vanilla client/server protocol.Client to server communctions are no problem (yet :-)) . The problem is, that sometimes I want the server to initiate communcations to the client (I guess the client would be acting as the 'server' in those instances although the client is the one that makes the initial connection)Is there any way to do this without the server having to bind the client in the client's remote registry? That would require a open port and I want to avoid that for people who are behind firewalls. I was thinking the client could pass an instance of itself, or an instance of a bound stub, and as long as it implemented 'Remote' then it should be OK.I don't have a problem setting up a registry client side, but if I pass an instance of client that is either registry bound or unbound, as long as it implements Remote, (or rather an interface that extends Remote) will the server make remote calls on the client object?

Message was edited by:

SunDog

[1152 byte] By [SunDoga] at [2007-11-26 22:59:01]
# 1
It's done all the time. What you're looking for is called "callback." Sun has a tutorial.One note: Calling the client requires the client to open a port for communication. This happens when the client exports the remote object.
cooper6a at 2007-7-10 12:25:15 > top of Java-index,Core,Core APIs...