views:

489

answers:

2

I've been interested in creating a proof of concept chat program for a while 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++.

I appreciate your answers.

EDIT: 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). :)

PS. If the question is too subjective, please close it. I'm new to stackoverflow, and I hope this question is alright, but I'll understand if it is closed.

+4  A: 

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.

http://xmpp.org/

There are also plenty of open source implementations

http://www.kdedevelopers.org/node/65

http://www.jabber.org/

Aiden Bell
Thanks!This should get me started on the implementation to see some examples of similar designs.I really appreciate your answer!
Refanius
No worries. There is plenty of source to have a ganders at. Also look at Pidgin and libpurple. You could base your software on that!
Aiden Bell
Don't forget to re-share your source code if you build something off open-source software ;)
Aiden Bell
+1  A: 

Cannot really think at something better than the Chat example in the Boost.Asio documentation.

Search for the Examples documentation in Boost.Asio (sorry but as a new user I cannot add any hyperlink) ..

cheers, andrea

Andrea Carbone
Thanks for the additional leads.
Refanius