简体   繁体   中英

Client-Server Peer to peer using Java RMI

I want to build a client-server peer to peer network using Java RMI but I don't know how to start the foundation? how should I build? do u have any source code?

I made an RMI project for uni some time ago, you can check the source code out to see how the project is structured - https://github.com/andreborgesdev/FootballScoreRMI .

It depends on the kind of problem you have but the common parts between all are:

  • Server - Here you set up the connection, sockets and create the handler to process the request received from the client. You will also have to create the remote object and bind it to the registry.
  • Client - Again you have to set up the connection and sockets and create the requests to the server. Then from here to call a Method you can either invocate the remote method directly or locate the remote object from the registry.
  • You can also create an OO class to help you manipulate the logic of the objects and business logic if you're doing CRUD of other operations that can benefit from it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM