Skip to main content

Connecting to relay

1 reply [Last post]
jonnydscott
Offline
Joined: 2004-09-06

Hi folks.

I'm a newbie to JXTA. I recently downloaded the example code at:
www.petrovic.org/blog/2006/11/15/a-turnkey-private-jxta-net-demo/

I left the code untouched (apart from the seeds.txt) and got it running on the
same subnet. Then I tried moving the Rendezvous to a static server, the idea
being to have it as a relay and rdv server, but can't get the MyPeer peer to connect.

I've tried using both tcp and http, and netstat shows that the rdv/relay peer has
opened a socket on the specified port. The changes to code I've made are:

in MyPeer:

configurator.addRdvSeedingURI("tcp://inform-uat-atkinsglobal.com:8089");

configurator.addRelaySeedingURI("tcp://inform-uat-atkinsglobal.com:8089");

//configurator.addRdvSeedingURI(seedingURI);

//configurator.addRelaySeedingURI(seedingURI);

configurator.setUseOnlyRelaySeeds(true);

configurator.setUseOnlyRendezvousSeeds(true);

configurator.setMode(NetworkConfigurator.RELAY_CLIENT + NetworkConfigurator.RDV_CLIENT

+ NetworkConfigurator.HTTP_CLIENT + NetworkConfigurator.TCP_CLIENT);

configurator.setTcpEnabled(true);

configurator.setTcpOutgoing(true);

configurator.setTcpIncoming(true);

And in Rendezvous:

configurator.addRdvSeedingURI("tcp://inform-uat-atkinsglobal.com:8089");

configurator.addRelaySeedingURI("tcp://inform-uat-atkinsglobal.com:8089");

configurator.setMode(NetworkConfigurator.RDV_SERVER + NetworkConfigurator.RELAY_SERVER

+ NetworkConfigurator.HTTP_SERVER + NetworkConfigurator.TCP_SERVER);

configurator.setUseOnlyRelaySeeds(true);

configurator.setUseOnlyRendezvousSeeds(true);

configurator.setTcpEnabled(true);

configurator.setTcpIncoming(true);

configurator.setTcpOutgoing(true);

configurator.setTcpPort(8089);

configurator.setTcpInterfaceAddress("inform-uat-atkinsglobal.com");

MyPeer just blocks awaiting the rendezvous connection. I've done a fair bit of searching

for answers, but can't find anything. Any ideas / sample code would be greatly appreciated.

Many thanks,

Jon

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jonnydscott
Offline
Joined: 2004-09-06

OK. I got it to work by not using a seed rendezvous, so presumably it uses
a default one that Sun provides to bootstrap. But it's left me a bit confused.
I notice that there are active connections to my relay before the edge peer
connects to the rendezvous, but no rendezvous event is fired on my relay.
It's only after it connects to the rendezvous that I get a connection event on
my relay.

I got someone at work to run it and they could see messages from me and I from
them (I was at home behind a router and firewall). So it appears to be working
from behind our corporate firewall and is presumably going through port 80.

So what I'm confused about is that I thought the architecture in this scenario
was that you needed to connect to a relay peer first. It appears to be connecting to
a default rendezvous first. Also, is it not possible to use the same peer on the
same port as both a relay and rendezvous?