The rebirth of diocp3
It has been more than a year since I started to write diocp. In the past two months, I have been thinking about a 30x24 stable enterprise server architecture, so that programmers can focus on logical implementation. Although the communication layer of diocp is very stable till now, if you want to implement this architecture, you will find a lot of inconvenience. So I had the idea of rewriting diocp.
Selection of Open Source servers:
Most of the Code has been written some time ago, so we need to install a home for diocp3. Google is obviously not working and is always on the wall. Then you are going to select http://sourceforge.net/and find that my QQ email cannot receive verification emails. GitHub has been selected after several twists and turns.
Open Source Address https://github.com/ymofen/diocp3 of diocp3
About open source:
Since the Open Source of diocp, the biggest benefit should be myself. I have made many good friends and got a lot of help and support from them. Diocp is also stable. Some friends learned that I wrote diocp3 and advised me to make a commercial version. After thinking about it, I decided to use open-source diocp3. In order to enable the use of diocp3 in commercial software, I chose BSD for the use of open-source protocols. The following is an excerpt from Baidu.
BSD Code encourages code sharing, but it must respect the copyright of the Code author. BSD is a friendly protocol for business integration because it allows users to modify and re-release code, and also allows users to use or develop commercial software release and sales on BSD code. Many companies prefer the BSD Protocol when selecting open-source products, because they have full control over these third-party code and can modify or perform secondary development as necessary.
About diocp3 functions:
The iocp engine is also the core part of diocp. It contains four files (iocpengine. Pas, iocplocker. Pas, iocpprotocol. Pas, iocpstringres. PAS) to implement the basic iocp model. It is also the core of other parts.
The Application of iocp model in socket. Iocptcpserver is a highly concurrent server component. iocptcpclient is a client socket. Similar to twsocket in ICS, it is based on the iocp engine.
Include (ubuffer. pas, uiocpcoder. pas, filelogger. pas, uiocpcentre. pas, uiocpfilelogger. pas, iocpcodertcpclient. (PAS) file, which enhances the client and server components, integration and encoding and decoder, client and server. It only needs to deliver objects, and does not need to deal with tedious sticking packets in the business, function classes compatible with diocp1.
Task shipping + asynchronous callback based on the iocp engine. Iocplogger is a log record based on iocp-task. It can ship information to the main thread and record logs to memo.
You have stored all the code in the source directory for reference.
Demo of diocp3
Stored in the samples directory
Echo:
The General echo function is used to test the server. The echo \ bin \ below stores the dbiocptest client and qsl's echoclient.exe, which is well written and I have not repeated writing. At present, we have tested the concurrency by 15 kb and it has been running for 2 days.
Iocptask:
Simple demo of shipping task
Socket-coder:
The implementation of message push, a simple demo that the server actively pushes messages to the client
* For each version. dproj files are not compatible. In the demo, files other than DPR are not submitted. Please set the project search paths or add diocp3 \ source to the library path when compiling the demo, you can compile the demo of diocp3.
About Setting environment variables in Delphi
Project directory settings
$ (Diocp3_home) \ source;
We have tested several beta versions and released the first version of diocp3. If you have any questions, please contact the group.
Diocp (Delphi □iocp) Communication Group: 320641073
Last thanks:
The idea of iocprequest given by Ryan. Thanks to QSL for its many suggestions, qdac-swish for its many code and ideas (iocp-task, originated from qworkers), and QSL for its demo testing.