• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is there any connection between secket and RMI

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any connection between secket and RMI?
because i was asked by interviewer the there is two JVM running and that JVM needs communication.
how can we do that.
i told using RMI.but he needs the answer Socket programming.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are any number of ways for two JVMs to communicate, RMI being one of them. Most of them (including RMI) will use TCP/IP sockets at the lowest level. RMI in particular has kind of fallen out of favor, though - these days one would rather use web services.
 
Rob Spoor
Sheriff
Pie
Posts: 20546
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like Ulf said, most communication methods are programmed on top of sockets. With RMI that's even clearer; UnicastRemoteObject has a constructor that takes both an RMIClientSocketFactory and an RMIServerSocketFactory. The sole purpose of those interfaces is create Socket / ServerSocket instances. If you use one of the other constructors a default is chose for each factory, and you'll use java.net.Socket and java.net.ServerSocket.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic