M
M
Mars362021-05-06 19:54:42
Qt
Mars36, 2021-05-06 19:54:42

How to properly organize a serverless p2p messenger and work with large projects correctly?

I want to make a p2p chat in the form of a "pet project", and in one thing I will learn how to work with large (relatively?) projects and understand their structure, for example, if there are some non-standard solutions, why did they do it this way and not otherwise. For peer-to-peer solutions, I found such an interesting thing as DHT (Kademlia dht). Libraries built on Qt I could not find in principle. Of the other DHT implementations in C++, there is openDHT, which, as I understand it, only works under linux due to dependencies such as msgpack-c, GnuTLS, etc. There is also madesave-dht, but it is painfully ancient and the last commit on the git was more than 10 years ago. I decided to see how it all works in other large projects, because. at the same time I wanted to try to learn how to understand the structure of large projects. Decided to look at qTox( https://github.com/qTox/qTox). As part of the sources, there is a "core" folder in which, as I thought, there is a DHT implementation and networking, I thought that I could just pull out this folder with the source codes of the core of this messenger and simply screw my modules and interface to it. But after looking at the source code in a little more detail, I realized that it would not work just to take and use the kernel, because. it is very closely woven into other modules, for example, it uses objects from other modules (toxString and others), and you either need to write their analogues, and even if you try to write their analogues, I don’t know if I have enough skills for this, and how many time will it take? If you try to take all the dependencies necessary for the kernel, then this will already be more than 90% of the qTox sources, and what's the point then?)

Ultimately, I want to know if there are any libraries for implementing peer-to-peer networks for transmitting short messages, files.

PS Surprisingly, such a popular topic, and there are so few implementations, I am haunted by the thought that I was looking badly, but after spending two days looking for some kind of ready-made version, I found almost nothing, quickly going through the sources of other messengers, I realized that they have their own implementations of the network part, and it’s impossible to just take and get such implementations, because the volume is too large and in such implementations there are very specific things that are needed only in projects for which such implementations were written.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2021-05-07
@SaNNy32

https://doc.qt.io/qt-5/qtnetwork-network-chat-exam...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question