• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1411
  • Last Modified:

p2p chat application, please help!

I am doing some research on mobile ad hoc networks and need to design a java chat program to run on the nodes in this ad hoc network. Basically the chat application has to be p2p based software as the testbed is setup to investigate decentralized environments and performance of wireless networking.

I need the source code for such a simple chat application that would enable two nodes in my network to communicate with each other. Please note that this is a truly ad hoc network and no internet connectivity or connection to a fixed infrastructure is present. The current setup contains nodes which are running SUSE 9.1.

It has to be a tcp based application if possible.

any help would be be greatly appreciated!

Thanks,

Nav
0
Navgod
Asked:
Navgod
  • 5
  • 3
  • 2
  • +2
1 Solution
 
Mayank SAssociate Director - Product EngineeringCommented:
0
 
NavgodAuthor Commented:
Hey!

Just to clarify,

I am not lookin for framework to support a p2p application on the internet using overlay networks or by forming a virtual p2p network over the net....i want to knw if it is possible to have a tcp based simple chat application in java that can enable me to communicate between two nodes....there is no internet infrsatructure....need somethin in the lines of a LAN..

chat application that is serverless....

I hope this helps..

Nav
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Mayank SAssociate Director - Product EngineeringCommented:
XNap is server-less, I guess. Supports P2P chat.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
XNap also has a framework, so maybe you need a server. I guess this is what you want:

http://sourceforge.net/projects/javap2pchat

http://sourceforge.net/projects/ashcast
0
 
Giant2Commented:
>chat application that is serverless....
Mhmmm. I believe you need to study better what you need.
The communication between 2 point could be done in 2 manner:
1) directly (as you need)
2) using a server

directly connect suppose that both point must know the address of them. The problem is how the can know it?
...using something to ask for.

;-)
Bye, Giant.
0
 
NavgodAuthor Commented:
Yes the application connects to the other node directly….as it is serverless it can only connect to one node at a point in time. You can have group conversations in an environment whereby there is a server instance running on the network within a node and the rest of the nodes have client instances running which connect to the server and this way you have a communication interface formed within the network.

My research however is on ad hoc networks whereby the nodes are all mobile….so there has to be no single point of failure therefore the server/client model is not a good way to do my research.

Simply put….i need a java application that I can run on two nodes on this wireless ad hoc network and be able to chat via this application to the other node. Therefore basically say I would input the IP address of the node I want to send the message to and this would be in the same IP range and subnet as the source node wishing to send the message.

My idea is to monitor this packet transfer between the nodes via this chat application so I can evaluate packet loss, latency, transmission range and node mobility issues in mobile ad hoc networks. Ad hoc networks are formed on demand without the need to have to connect to any fixed infrastructure….which is why the application cannot be like the standard p2p application that runs on the internet by forming overlay and virtual networks.

I need the source code so I can understand the application functionality and modify the GUI in my own way.

Nav
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> so there has to be no single point of failure therefore the server/client model is not a good way to do my research

Well, but you have to appreciate the fact that wireless broadbands work well :)

>> ….i need a java application that I can run on two nodes on this wireless ad hoc network and be able to chat via this
>> application to the other node.

Try the Java P2P Chat from Sourceforge. You don't have to bother about what the underlying network is as long as the TCP/ IP protocol is supported - the physical connection can be through a phone-cable or wireless, for example.
0
 
Giant2Commented:
>I need the source code
I believe this is out of this site. We cannot post full code, but we can help you constructing yourself.

You need a full socket control to stablish this inter client communication.
Here could be some example:
http://javaalmanac.com/egs/java.net/CreateClientSocket.html
http://javaalmanac.com/egs/java.net/pkg.html#Sockets
http://www.java2s.com/Code/Java/Swing-JFC/SocketApplet.htm
http://www.java2s.com/Code/Java/Network-Protocol/SocketOpenerationTest.htm
and so on.

Bye, Giant.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Many of the sourceforge projects are open-source so you can download the source from there itself. For example AshCast has the source available in the downloads:

http://sourceforge.net/project/showfiles.php?group_id=161535&package_id=183197&release_id=404004
0
 
objectsCommented:
following covers a simple chat example:

http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat.html
0
 
Giant2Commented:
:-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now