Transferring UDP Files to Delphi

I am writing a program to transfer files through lan computers while I was looking for methods of transferring files in Delphi. I found that UDP is a good solution, but there is a problem: in each example or article I found that there is a client program next to the server program, but my program should send and receive to / from each computer on the network, there is no specific server or client , something like p2p, I do not want to make a Sever computer and another client, what should I do? I also searched for Indy articles, also working in Server / Client mode (as far as I found).

enter image description here

A reliable question will be clear enough

+4
source share
2 answers

Take a look at the Indy TIdTrivialFTP and TIdTrivialFTPServer . TFTP is a UDP-based file transfer protocol.

+4
source

UDP can work in broadcast mode, which is what you need. But such UDP broadcasts are not routed outside the current network (i.e. blocked by routers), so you need to implement something more complex if your project needs to be accessible outside the main physical network.

Do not reinvent the wheel! If you want to see some working source that implements this concept, see Ares Galaxy:

"Delphi p2p self-organizing networking project with high-scale capability and fast broadcast type search engine. Client supports file transfer with multiple sources, partial file sharing, built-in audio / video player and decentralized chats."

Source files are available from SourceForge . You can reuse / adapt the P2P network layer for your needs, but pay attention to the Ares source code license terms if you use it in your projects.

+6
source

All Articles