Samples directory Below is a demo that comes with your own
Found a lot of friends do not know how to start DIOCP, the following is a brief description of the demo, I hope to be useful to everyone
C#\simple
A simple callback test written in C #, the service side opens the Echo server
Samples\echo
The IOCP is sent back to the client immediately after receiving the data from the server.
You can see from this demo how to receive data on the server and return the data.
Samples\iocptask
Iocptask Demo demo, asynchronous task execution demo,
The demo can be used to learn how to deliver tasks to the main thread to execute (Access UI is best accessed on the main thread).
You can learn how to register a signal task, how to trigger any signal, and how to counter-register the signal.
The signal task can be registered in one place and triggered by a signal in a sub-thread, which can be effectively decoupled from your code.
More features can be used in the QDAC3 qworkers
Samples\qdac3-source
QDAC3 Project source code, excellent open source project, you can update to the QDAC project to update the latest version,
Some of the demos are used.
Samples\safelogger
Safelogger's use of demo,
You can learn how to use Safelogger to display logs to memo in this demo.
How to use Safelogger to log records to a file.
Samples\simple
The simplest example of DIOCP use
The client takes blocking mode, sends the data to the server, and then the server returns itself, and the client waits for the data to be received.
=================================================================================
Samples\socket-coder
The encoder mode of the demo, the existence of the encoder pattern allows you to use the demo when the direct transfer of objects, without you to deal with the sticky bag problem,
The encoder mode sends the received object to the Iocptask/qworkers thread after decoding succeeds, which does not block the DIOCP communication thread, even when dealing with complex business logic, and does not affect the data receiving and sending.
Samples\socket-coder\diocpcoders
Some of the commonly used encodings and decoders,
Jsonstream: Contains a JSON and a stream
TStream: Universal Simple TStream object, header tag + CRC + data length + data
The Tmsgpackcoder:msgpack object. Using Qmsgpack for parsing
It is recommended to build encoding and decoding modes using Tstream, because many objects can be serialized to and restored from the stream.
For example TStream->msgpack, DIOCP, Msgpack, TStream
Samples\socket-coder\streamcoder
Stream Encoder Mode example.
You can learn from this demo that if you send a Tstream object directly, how you receive it on the server, if you push a stream object to the client.
You can learn the use of iocpcoderclient (client IOCP) in this demo.
The client has blocking mode (rawtcpclient) and asynchronous accept (client) mode.
Samples\socket-coder\datamoduledemo-andriod
Example of exchanging data between mobile Andriod client and DIOCP server
You can learn how to request DIOCP Execute SQL statements in Andriod to return a tclientdataset of data and display them on your phone
Samples\socket-coder\datamoduledemo
Three-tier data presentation
You can learn how to request the DIOCP Execute SQL statement in the client to return a tclientdataset of data and display it on the client
Samples\socket-coder\datamoduledemo-simplemsgpack
Use Simplemsgpack instead of qmsgpack, which can be used in D7
Samples\socket-coder\diocpfileserver
Demonstrates how DIOCP is used as a file server
Can learn to upload files and download files if chunked
"Diocp-demo Instructions" for a brief description of all demo demos