aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Use of sockets through RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Use of sockets through RMI" Watch "Use of sockets through RMI" New topic
Author

Use of sockets through RMI

Dhananjay Inamdar
Ranch Hand

Joined: Jan 27, 2003
Posts: 130
WE all know that if we are using a sockets then we have to declare our own application protocol to facilitaes the inter-communication across our application.
For this disadvantegeous reason of Socket insdutry moves to RMI. But RMI also internally uses sockets over http. Then how can RMI make the use of IIOP with sockets. If it is possible through rmi then why can't we use sockets with IIOP insted of RMI?
I am really confused, anybody knows anything then kindly let me know.


Just like you, struggeling to get the right solutions!<br /> <br />Sun Certified Java Programmer 1.5<br /> <br />Target - SCWCD
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
I cannot understand your question. Could you possibly rephrase it? Are you asking if RMI/IIOP uses sockets? What do you really want to know?
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Dhananjay Inamdar
Ranch Hand

Joined: Jan 27, 2003
Posts: 130
Ok I will try my best to re-phrase and make understandable my question.
I read that sockets are used preious to RMI, but the problem with sockets is that we have to declare the application protocol for inter application communication.
So, now we are using RMI, which uses IIOP protocol. But I read this also that RMI internally use SOCKETS on Http.
So, my question is
1) How RMI use sockets with IIOP insted of application protocol?
2) If it possible through RMI to use another protocol with socket then why we can't do this directly wihout making the use of RMI?
I hope this time I have presented it in a descriptive way.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
I'm sorry, I still don't undestand this crucial line "the problem with sockets is that we have to declare the application protocol for inter application communication".
What do you mean by "declare the application protocol"? Are you saying that a problem with RMI is that it is a proprietary protocol, as opposed to IIOP? I'm sorry, but I'm still struggling to understand what you are saying...
Also, BTW, IIOP does not sit on top of HTTP. There is a feature called "HTTP tunnelling" that you can exploit, but IIOP and HTTP are usually peer protocols, both of which are written on top of the TCP/IP (socket) layer.
Kyle
Dhananjay Inamdar
Ranch Hand

Joined: Jan 27, 2003
Posts: 130
I read the following paragraph in reference with sockets.
"Sockets are used priorely to the RMI, but the main problem with socket is that we have to declare our own application level protocol. This protocol required in-order to facilitate the communication across applications which are communicatiing this scoket"
Then in the next paragraph they mentioned that
"RMI also internally uses the sockets over HTTP, but uses the IIOP protocol"
So I am thoroughly confused that when
1) In normal condition
Socket + Application level protocol
required which is not preferable.
2)RMI uses a scoekt in following way
RMI + Socket + IIOP

So , my questions are as follwes
1) How does RMI uses the IIOP with Socket insted application level protocol?
2) If RMI can use IIOP with sockets then why can't we directly use IIOP with sockets in-sted of pulling RMI in picture?
I hope this time you will understand the problem which I want to present.
Thanks for your co-operation.
Vijayakumar Arya
Ranch Hand

Joined: Jan 27, 2003
Posts: 76
Hi Dhananjay,
I think you are bit confused over sockets, RMI, and IIOP.
Sockets - are connections between two applications running in the same machine or miles apart(connected through internet - forget about firewalls for the time being). These exchange streams of data between the two applications. To interpret the data that is received in the socket we need an application level protocol the one which you are referring to.
RMI is an application level protocol used to communicate between two remote Java objects, recognised only by the RMI framework.
IIOP is another application level protocol that is used to communicate between two or more remote CORBA objects. To provide inter-operatability between RMI and CORBA, another implementation of RMI supporting both RMI/IIOP protocols have been developed. Now using RMI that supports RMI/IIOP you can directly execute the CORBA object written in C++ or any other language as if you are executing a Remote Java Object.
Does this answer your query.
Thanks,
vijay.


Thanks,<p>Vijay<p>The Hand that gives, Gathers.
Dhananjay Inamdar
Ranch Hand

Joined: Jan 27, 2003
Posts: 130
Hello Vijayakumar,
Thanks for your reply! This is a really very good answer. I am noe crystak clear about all these terms, about which I was confused previously.

- Dhananjay
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of sockets through RMI