Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating Peer to Peer connections using intermediate server

840598Jul 20 2012 — edited Jul 20 2012
I want to connect two clients (via TCP/IP sockets in Java). The clients can discover each other using an intermediate server. Once the clients discover each other, there should not be any involvement of the server.

I made some study about this and found many people suggesting JXTA. But I'd like to create the protocol myself from scratch (because in future I might have to implement the same using WebSockets as well (when my client is a Browser)). Currently, my clients can be Desktop applications or mobile applications.

My questions are:

1. How will clients discover each other at the server? If the server sends the global IP address of the clients to each other, will that information be enough to create a peer-to-peer connection? What if the clients are on the same LAN network and the server is on a different WAN?

2. Client have dynamic IP address. Can their IP change all of a sudden even if it has an active socket?

3. Is peer-to-peer connection is reliable for transfer of non-continuous data (like in chat application)?

[*NOTE*: by peer-to-peer connection I mean establishing a client-server TCP/IP socket connection by making one of the client as temporary socket-server]

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2012
Added on Jul 20 2012
1 comment
1,226 views