C++ – a good implementation of a peer-to-peer chat program with a server for assigning connections in C++


For a while, I've been interested in creating a proof-of-concept chat program using C++. I have given the idea a lot of thought and even wrote down the beginnings of how I would design the system, but I have hit a barrier in my thinking when it comes to the implementation.

I want to know what an implementation of a peer-to-peer chat client with a server to route connections would look like in C++.

The server would be used as a central registry of the peers, but not used as the primary connection. The server would not interact with the clients in any way except to assign connections between peers to achieve an optimal path between peers. In a first version, it would merely be a directory to which all clients connect, and the clients can then use the directory to connect to the other clients available for chat. (I hope that explains it a bit more). 🙂

Best Solution

You should look at the XMPP stuff. It is all about routing and co-ordinating messaging. It uses de-centralization and a peer-to-peer like architecture.

There are also plenty of open source implementations. For example,

Related Question