Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RMI Distributed Application 1

Status
Not open for further replies.

SON1

Programmer
Nov 21, 2004
51
CY
I am doing a distributed messaging system with RMI.

I have a central server which runs RMI registry.

The clients need to connect to the the server, to see which other clients are online and then start communicating directly between them p2p. The clients will not be running RMI registry.

How is it possible to have the clients chatting directly between them ? I understand that they should expose some kind of functionality, but how do the other clients find out ?

 
Two options I can think of :

1) Set up P2P networking using Sockets or something between the two clients (and don't involve the central server after initial setup has occured)

2) Use the central server as a message queue - clients sit and poll the server for new messages. If you use this model you might want to look into JMS rather than RMI as a lot of this functionality is provided for you.

--------------------------------------------------
Free Database Connection Pooling Software
 
isn't it possible for the clients to chat between them with RMI instead of sockets ? rmi registry isnt it only for the for name binding ?
 
RMI is just a wrapper for pure TCP/IP Sockets - so no ... and to use RMI one "server" must be running the rmiregistry - so no again I'm afraid !

--------------------------------------------------
Free Database Connection Pooling Software
 
it seems to me that i found a solution

The service server (where the clients connect) runs rmi registry, which name binds its services.

The clients connect to the service server, find out which clients are online. All clients register with the server with callback. The client's callback interface reference of the clients are available to lookup, so when a client wants to speak to another, it gets the callback refernce from the server, and calls the callback on the client. So although the clients register only with the server for callbacks, other clients get to steal the reference from the service server and use it as well.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top