Skip to main content

Connecting but not finding Advertisements.

2 replies [Last post]
sart
Offline
Joined: 2009-05-09
Points: 0

Hi,

I'm trying to develop a standard peer--to-peer application to share files.
I tried some code and got it working within a LAN.

When i try to configure it in a real world network, i'm able to get peers connected and join the group but it doesn't list peers or any other advertisements.

Machine #1 is one with a real IP and i get it working as relay and rendezvous in the same time. Firstly i tried to configure it through the graphic interface which show up when the code below runs:

"netPeerGroup = new NetPeerGroupFactory().getInterface();"

It seems, however, it doesn't take the configurations good enough because if i put the code to show what is it doing (like netPeerGroup.isRendezvous();) it gets false as response.
Then i tried to configure it within the code like i learned in another topic here:

manager = new NetworkManager
(NetworkManager.ConfigMode.RENDEZVOUS_RELAY, "Rendezvous", new File(".cache").toURI());
NetworkConfigurator myConfigurator = manager.getConfigurator();

myConfigurator.setName("Relay Peer");
myConfigurator.setDescription("Private Relay");
myConfigurator.setUseMulticast(true);
myConfigurator.setMode(NetworkConfigurator.RDV_SERVER +
NetworkConfigurator.RELAY_SERVER);

myConfigurator.setUseOnlyRelaySeeds(true);
myConfigurator.setUseOnlyRendezvousSeeds(true);

// Relay Server is has a LAN IP. It is running on a LAN
// It will be polled by a Jxta Peer running Socket Server on another
// machine that has a personal firewall.
myConfigurator.setHttpInterfaceAddress("REAL IP");
myConfigurator.setHttpEnabled(true);
myConfigurator.setHttpPort(9700);
myConfigurator.setHttpIncoming(true);
myConfigurator.setHttpOutgoing(true);

myConfigurator.setRelayMaxClients(100);

System.out.println(this.getClass().getName() + " Peer ID = " +
myConfigurator.getPeerID());
myConfigurator.save();
manager.startNetwork();

No sucess still...

Machine #2 is one in a local net. I have a router with real IP and my machine is behind it. So i use Machine #1 to get to the network.

NetworkManager manager = new NetworkManager(NetworkManager.ConfigMode.EDGE, "Group",new File(".cache").toURI());
NetworkConfigurator myConfigurator = manager.getConfigurator();

String seedName = "http://REAL IP:9700";
URI localSeedingRendezVousURI = URI.create(seedName);
myConfigurator.addSeedRelay(localSeedingRendezVousURI);

myConfigurator.setTcpEnabled(true);
myConfigurator.setTcpIncoming(true);
myConfigurator.setTcpOutgoing(true);

myConfigurator.setHttpInterfaceAddress("192.168.1.100");
myConfigurator.setHttpEnabled(true);
myConfigurator.setHttpIncoming(true);
myConfigurator.setHttpOutgoing(true);

System.out.println(this.getClass().getName() + " Peer ID = " +
myConfigurator.getPeerID());
myConfigurator.save();

manager.startNetwork();
netPeerGroup = manager.getNetPeerGroup();

I have the problems described above.
Although it finds and join the group, it doesn't like peers nor anything else.

Anyone can give me a light?

Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sart
Offline
Joined: 2009-05-09
Points: 0

I found the problem.
It was that i was creating a group different than the one i was using to search.
When i took the discovery service from one group, it wasn't finding anything because the service wasn't related to the group i wanted to search on.

The problem with not working outside a LAN was that i was not starting the Relay and Rendezvous service and listener, so it ended up switching to Edge role.

I have tested it without multicast option and i guess it's working properly.
I hope this saves some time of the next new jxta application developer.

sart
Offline
Joined: 2009-05-09
Points: 0

Hello again,

So, no one has a guess about what could be happening?
Let me try another question then.

What could be causing that the program only works in a local sub-net and not send requests to rendenzvous?

Do i need to build a special listener (like ServerSocker) to eventually receive back responses from a rendezvous or it already does listen for responses when i call the AutomaticConfigurator and configure that prior to start the program?

Please guys, give me some direction to go.
Thanks again.