Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can 2 client communicate each other using RMI

 
Prasath Thirumoorthy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Steve White
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic