• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Java RMI - p2p chat  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys I'm using java RMI to make a p2p chat with leader election. The first step that I have problems with is that I just want to make every client a own remote object so they can communicate with eacother through rmi but I don't know how to do it. Here's my code if someone wants to try to get me on the right track:

Client:


server:

server interface:


Node:


server impl:


node interface:

 
Saloon Keeper
Posts: 5391
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RMI is not a good fit for implementing a P2P solution due to its client/server nature. Have you looked at technologies like Apache River? They'd be a better fit due to their P2P architecture.
 
Paul Larsen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:RMI is not a good fit for implementing a P2P solution due to its client/server nature. Have you looked at technologies like Apache River? They'd be a better fit due to their P2P architecture.



I have to use RMI for this homework... which I have a lot of troubles starting with :/
 
Saloon Keeper
Posts: 20635
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, if you have a collection of peers who directly communicate with each other, that's NOT a client/server architecture. And it's not suitable as such for RMI.

RMI is a client/server architecture, so every client must communicate with a server. To do anything resembling peer-to-peer broadcast, each client would itself have to be an RMI server.

RMI can function as a chat server, in the manner of a classical Internet Relay Chat but the clients would all have to log into a central RMI server, and that server would then have to echo (relay) everything it received from one client to all the other clients.
 
Trust God, but always tether your camel... to this tiny ad.
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!