This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes is there any connection between secket and 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 » Sockets and Internet Protocols
Bookmark "is there any connection between secket and RMI" Watch "is there any connection between secket and RMI" New topic
Author

is there any connection between secket and RMI

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
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
Marshal

Joined: Mar 22, 2005
Posts: 42372
    
  64
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.


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: is there any connection between secket and RMI