Re: 2-way RMI-Connection

Jeff Rickard <[email protected]> Sat, 26 May 2007 12:55:12 -0600
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
If you are using applets is it your intention to deploy this on a
website for public use?  You are going to encounter many problems with
firewalls and the like with this two way connection scheme.  Have you
already decided not to go with a polling routine from client to server
to check the status?

I have done this with standard java/swing applications but never from an
applet, I would imagine that you need to bind the listening port as part
of the constructor, or during the initialization, for the client and
then you just pass the ip address of the connection back to the server.
This also requires that the stubs are at both ends so you need to have
all the interfaces and what not set up that way as well.

I don't know if that helps but if you need I could dig up some sample
code that I have here somewhere from the application that I wrote doing
that.

Jeff Rickard

Michael Tomuschat wrote:
> Hi,
>
> I want to write a client/server program. The client (an applet) can send
> commands to the server and the server can send status-information to the
> client.
>
> the server binds the command-class to the rmiregistry so the client can
> send commands to the server. The other way round the client registers his
> status-class in the same rmiregistry, so the server can update the
> client's status, when something changes.
>
> This works perfectly well, when client and server are on the same host.
> But when the client is on a remote machine it cannot bind the
> status-interface to the rmiregistry any more (Access Exception: registry
> rebind disallowed from non-local host)
>
> So, how can I bind the status-class on the non-local host, or if this is
> not possible, how can I make the server call the applet's status-class??
>
> Is RMI the right tool for this task??
>
> Thanks for any tips
>
> Michael
>
> ===========================================================================
> To unsubscribe, send email to [email protected] and include in the body
> of the message "signoff RMI-USERS".  For general help, send email to
> [email protected] and include in the body of the message "help".
>
> For a list of frequently asked RMI questions please refer to:
> http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html
>
> To view past RMI-USERS postings, please see:
> http://archives.java.sun.com/archives/rmi-users.html
>

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html