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

*爱你&永不变心* 提交于 2019-12-02 13:53:53

问题


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.

回答1:


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.



来源:https://stackoverflow.com/questions/25475644/identify-client-in-peer-to-peer-filesharing-using-java-and-corba-and-build-sock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!