简体   繁体   中英

Identify client in peer to peer filesharing using Java and Corba. And build socket socket between 2 Clients

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM