Hi, can anyone help mi to realize decentralized chat, i dont know how to start.
Printable View
Hi, can anyone help mi to realize decentralized chat, i dont know how to start.
please explain more. provide some code or something
I dont have any code, I have to do it, the basic is that chat doesn't have constantly server, when one client it join like first, that client will be server, when this client quit, next client will be turned to server.
just do what I did with my instant messaging program. but in the run method when it calls the exception just have it make it a server socket instead of a client socket
Few things comes in mind about such system. You need to have some sort of discovery system of the clients. User can keep the list of clients in local database and try to connect each until it gets a live client.
Clients can then coordinate with each other for the discovery. A general topology of p2p file sharing system will help.
Look for other ideas for the discovery
Once they are discovered .. a client can act both .. client as well as server with other peer ..
No matter what you do you still need one or a few central places where to register potential servers and where clients can find the addresses of potential servers. Otherwise you have a chicken and egg problem.