Skip to main content

JXSE connection from 1 peer to another over lan (not on 1 single pc)

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
headgrowe
Offline
Joined: 2012-03-18
Points: 0

hey all,

i am new, of course... i tried allready all the examples in the tutorial packed, but i still don't know how to connect from one machine to another...there are no firewalls ord NATs between (therefore no RV needed)... just the right code-snipped is missing

pls help me out

bye headgrowe

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
headgrowe
Offline
Joined: 2012-03-18
Points: 0

In order to establish initial JXTA network context it is optimal to specify seeding (aka bootstrap) information after which the peer is free to leverage discovered resources as needed at runtime. Seeding RendezVous and Relays are typical and in fact for "edge" scenarios only the later is required. RendezVous peers serve as a connection resource with which newly instantiated peers can leverage in the form of leases. Relay relationships are established for peers that can not otherwise communicate with one another in a direct fashion which is common for applications running behind corporate firewalls accessing services available on the open internet. These relationships change dynamically as the netork itself changes yet the developer is presented with a unified view of the overall network. A seeding address, be it RendezVous or Relay, takes the form of a fully qualified IP based URI, with examples being:

tcp://1.2.3.4:9701
http://1.2.3.4:9700

A seeding URI is a simply a resource that returns a list of available seeding addresses as defined above. As such, as seeding URI is often specified with a common domain name, e.g.:

http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2
http://rdv.jxta.hosts.net/cgi-gin/relays.cgi?2<font face="monaco, courier, 'courier new'"> <br type="_moz" /></font>

The following methods can be used to specify RendezVous and Relays network resources in addition to whether or not the to be configured peer can leverage newly discovered services:

configurator = manager.getConfigurator();

  public void setRendezVous(URI) 

....

headgrowe
Offline
Joined: 2012-03-18
Points: 0

the rdv-service you have also to start... check this webside out code.google.com/p/peerdroid/wiki/PeerDroidTutorial