Skip to main content

HELP jxta 2.5_RC3 and sockets

2 replies [Last post]
anegri
Offline
Joined: 2007-07-26

Hi,

I build a P2P tool for transfering XMl data across clients. I tested it on my machine only and it worked fine (running two clients). I tested the application with a client on a different PC and my connection times out. I originally started this development with the RC1 and currently upgraded it to the RC3. I am in a managed network, so I am not sure if I would have to change my configuration. I also tried running the samples for the Sockets and BiPipes provided in the programming guide (the latest 2.5) and I cannot connect to the other machine.

I did run myJxta with Java webstart and it worked fine across both machines from the 2.5_RC3 release download page.

I could really appreciate hints or issues of why this is happening. I will try to recompile these examples in my home network and see if it runs. Any reason why it would always time out?

Many thanks,
Alessandro

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
anegri
Offline
Joined: 2007-07-26

Well I think I might have configuration problems. I looked into the NetworkConfigurator, and I could be having some issues and that might be why I cannot connect the two peers within the network.

I created a small shell client/server application working with the JxtaBiDiPipe, and was able to connect only one time out of several tries within my network. I have attached the code, perhaps someone could point me out where I have gone wrong. I set both clients as ADHOC's... I am not sure wether I should be using PEER, ADHOC, RENDEZVOUS, or RELAY (I am not sure which one I should use for what).

The EchoServer listens for peers and all it does is it echos back the messages. The RemoteClient is a small shell that connects to the server and allows sending messages to it. It also contains the discover command that will display the peers in the network. Both client and server use the EchoDiscover to publish and obtain remote/local advertisements. I think if I can get this small test app working I should be able to get my larger socket application.

This is very barebones application, that I might have set up the connection set up wrong or not setup the NetworkManager or NetworkConfigurator improperly.

Many thanks,
Alessandro

hamada
Offline
Joined: 2003-06-12

Ad-Hoc should be used in a multicast only environment, typically when testing on the same machine or local sub-net. otherwise I suggest Edge instead, a rendezvous should be utilized when crossing sub-nets or the internet, a relay should be utilized when separated by firewalls, and direct connectivity is not possible.

As for the sample application, it seems that a propagated pipe is more suitable if you were to mimic an echo server, which a udp based service. The propagated pipe tutorial offers similar behavior, where the server side unicast responses, rather than propagate.