This is a feel-good communication program that features:
1. The data packet format is all defined by yourself.
All definitions and communication core classes are in the COMM folder.
2. It can handle the situation where a large number of clients communicate at the same time. The client and the server share the same communication object and can realize mutual transmission.
3. All communication details are encapsulated in several common classes, hiding all processing details of interactive communication, such as packet disconnection processing, timeout retransmission and other functions.
4. Data communication and data specific applications are completely separated and have good scalability. In this example, we only make an example of uploading files. You can achieve any function required for remote control without changing the communication core, and there is no need to Consider communication details. For specific methods, please refer to: TSrvApp_File class of CommSrvApps unit. Just write a new class:
TSrvApp_File = class(TServerAppObject)
public
function ProcessData(ABuf: PChar; ASize: integer): integer; override;
end;
Through the above classes combined with the communication core class, remote real-time transmission of a file is as simple as copying.
other:
This program is an application example of data exchange in a supermarket chain solution that I developed myself, so there is a lot of code on the client and server, but most of it has nothing to do with the communication itself. The function implemented is to connect the local Local folder to the remote Remote folder .rs files are transferred to each other.
If you have any suggestions, please come to www.acreport.com to communicate, or write to me: [email protected]
Author: shaoyy