1

I am developing a peer to peer file sharing application usig Java and CORBA. I am new to CORBA.

So far I have successfully created a client program that registers a file in the SQL Database via CORBA. The table stores the following information :

  1. filename
  2. Share(Basically, it stores the option of sharing or not sharing the file in the network)
  3. HostName
  4. PortNumber

I am stuck at this point:

  1. How do I find the hostname and portnumber of a client when registering the files to SQL?. Because I believe with the hostname and portnumber, I will be able to build a socket connection between two client programs and therefore start sharing file between peers.
The Third
  • 785
  • 2
  • 10
  • 30

1 Answers1

4

There is at this moment no standardized way to retrieve hostname/portnumber of a CORBA client, the reason is that CORBA is not tied to just sockets, there could be multiple kinds of transports which have completely different ways for addressing. Some ORBs do have some extension to make this possible, for example TAO has a TransportCurrent feature that does give access to this kind of information at the moment the client connects with IIOP. JacORB does have support for org.jacorb.transport.iiop.Current which also looks similar, have a look at that.

But why not use CORBA for the file transfer? Than you don't have to get this information but just can store the stringified object reference and use it at a later moment.

Johnny Willemsen
  • 2,942
  • 1
  • 14
  • 16
  • @Johny I had a similar problem.. can you point me to a few examples for filesharing with corba to successfuly build a p2p application. – fscore Aug 25 '14 at 13:12
  • There are a few examples of a content server as part of TAO, download the distribution from http://download.dre.vanderbilt.edu or check them online at https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/TAO/examples/Content_Server/ – Johnny Willemsen Aug 25 '14 at 13:44
  • But hw can I use corba for filetransfer.. I am more interested in the 2nd half of your answer. – fscore Aug 25 '14 at 13:51
  • @JohnnyWillemsen, What is a stringified object reference ? – The Third Aug 25 '14 at 14:15
  • Oh okay I understand it is the step to recognize the service in remote server. But how can it identify two different clients. And then transfer files between them. – The Third Aug 25 '14 at 14:44
  • @TheThird Have a look at the CORBA explained simply book for more background about CORBA and its concepts, see http://www.ciaranmchale.com/corba-explained-simply/index.html. You need to get the object references of the two clients and use these to transfer the files. – Johnny Willemsen Aug 25 '14 at 15:21
  • @fscore See the examples of TAO, it are content servers and they use an IDL defined operation to transfer the files. – Johnny Willemsen Aug 25 '14 at 15:22
  • A test for JacOrbIIOPTransportCurrent: https://github.com/JacORB/JacORB/blob/master/test/regression/src/test/java/org/jacorb/test/transport/IIOPTester.java – weberjn Nov 25 '19 at 14:54