We help IT Professionals succeed at work.

p2p chat application, please help!

Navgod asked
Medium Priority
Last Modified: 2012-08-14
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!


Watch Question

Mayank SPrincipal Technologist




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..

Mayank SPrincipal Technologist

XNap is server-less, I guess. Supports P2P chat.
Mayank SPrincipal Technologist

XNap also has a framework, so maybe you need a server. I guess this is what you want:



>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.


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.

Mayank SPrincipal Technologist

>> 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.
>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:
and so on.

Bye, Giant.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Mayank SPrincipal Technologist

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:

Mick BarryJava Developer
Top Expert 2010

following covers a simple chat example:


Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.