wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes how can 2 client communicate each other using RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "how can 2 client communicate each other using RMI" Watch "how can 2 client communicate each other using RMI" New topic
Author

how can 2 client communicate each other using RMI

Prasath Thirumoorthy
Ranch Hand

Joined: Jul 23, 2004
Posts: 65
Hi Friends I know how to access a remote method from the client but i want to communicate 2 clients i dont know how to do that can anyone give me some idea or sample code for how v can make 2 clients to communicate throu server using RMI.I thought of doing a chat in LAN using the idea/concept.
Help Me Plz


Thanks,
Prasath

SCJP1.4, SCWCD
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You're going to need to implement something called a "remote listener" or "RMI callback" to do this. Someone else asked about this a few days ago, and that thread has a link to an example and further descriptions of this concept.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Steve White
Greenhorn

Joined: Aug 04, 2004
Posts: 2
I have a nice simple example of a chat app (server and client) using Sockets. The problem is that it's about 350 lines of code (including comments (which are in Spanish but I'm not going to translate them)).

How should I get the code to you? Email?

Steve
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
For more complicated communication beyond 2 person chat, you can use one of the APIs that work on top of RMI, such as Java Message Service, Jini or JavaSpaces.
Bill
Prasath Thirumoorthy
Ranch Hand

Joined: Jul 23, 2004
Posts: 65
hi Steve thanks for ur rply it would be useful for me if it is in english how can i translate that code which is in spanish to english and i need the code in RMI thank u very much for ur help
with regards
prasath
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how can 2 client communicate each other using RMI