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
NavgodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.