Mstdlib-1.24.0
|
Modules | |
Base I/O subsystems | |
Add-on IO layers | |
Semi-Public interfaces | |
Event Subsystem | |
Common I/O functions | |
Common Blocking (synchronous) IO functions | |
The I/O system is designed to be a series of stackable layers. For example: Client - Trace <-> TLS <-> Net - Server.
Data flown through each layer and each one process the data accordingly. In the above example the trace has the ability to print the data before it's encrypted and put on the wire and after data has been received and decrypted.
Layers for the most part can be any order. Some layers are required to be at a certain level. For example, Base layers like Net should always be the bottom most layer. However, you could have Client - TLS <-> Trace <-> Net - Server. Unlike above the Trace layer would have access to the data after it's encrypted. Or before it's decrypted. Suffice it to say, order can make a huge difference in how data is processed.
At a high level the use of an I/O connection should have minimal if no dependency on knowledge of lower layers. Meaning, if you're working with a device that supports multiple connectivity methods there should be no code changes needed for different Base I/O connections. That said some layers, such as Net, expose additional information that could be useful. That said, change from Bluetooth to HID should involve nothing more than changing the create function that sets up the Base layer.
The Event subsystem and I/O objects can be used independently of each other. The Event subsystem can be used for general event processing like you'd see in macOS or iOS. The I/O system can be used with a set of synchronous functions negating the need for and Event loop.