POHMELFS low-level IO machinery
I decided to use single thread per connection, which maintains sending and receiving state machines, where each IO unit has a completion callback, invoked when all requested data has been processed. In theory this can be extended to support multiple network connections per thread, but I will postpone this for the future, if practice will show that it is a major overhead to have single thread per connection.
When receiving state machine has nothing to do, it schedules itself to receive a command header which has fixed size. This unit completion will search for transaction which corresponds to given ID and invoke its completion, which in turn can schedule new receiving processing with own completion.
The same applies to sending, although data sending has empty completion callback (except debug dump about finished operation).
Transactions have fixed header size with optional (unlimited) data, since there is no more variable sized path in the header, instead system will use ID generated by hash transformations over provided data: either local path to object (from the root, which corresponds to global filesystem root) or data content.