Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of sockets through RMI

 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic