The DAP SDK network module consists of the following submodules:
A distinctive feature of software created to work in peer-to-peer ("p2p") networks is that, due to the declared equality (peerness) of network nodes, each of it must have the ability to perform the functions of both the client and the server. Of course, nodes can have both lightweight (mostly client-side) functionality, and vice versa - mostly perform server tasks, provide certain services. However, the general principle must be respected: a node (and a p2p node also "peer") is both a server and a client "in one bottle". This naturally implies the requirement for the network module of the node: support for a large number of simultaneous connections with other nodes.
DAP SDK provides the tools necessary to build the basis of a p2p application, which also offers rich cryptographic protection of network connections. Let's see what we have in the net arsenal. First, you need to put together a general puzzle picture that clarifies the architecture of the network module of the node. Here it is:
As you can see, the node contains both a client submodule and a server submodule. Since the client can send various requests to other nodes, and through the server, the node can provide various services to other nodes, communication between nodes is built on the basis of logical (virtual) channels that have special identifiers that allow the client to find the desired service at a remote node and communicate with it through the appropriate channel.
The client code is located in the DAP SDK Net Client submodule.
Server, respectively - in Server.
The Stream submodule is responsible for:
The main purpose of the reactor is to make the processing of data transmission and reception as efficient as possible, due to the use, on the one hand, of multithreading, on the other hand, of cooperative multitasking within each thread. This functionality is implemented in the DAP SDK Net Core submodule.
More detailed information on the network module DAP SDK Net can be found in the article "I/O, multitasking, network".