Add Minimal MTU information to CONTRIBUTING.md.

dependabot/npm_and_yarn/Src/WebController/UI/websocket-extensions-0.1.4
ja256 2019-09-03 13:32:02 +02:00 committed by GitHub
parent fc4b660903
commit e6dc83a35a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -381,6 +381,6 @@ There are two new elements in the header file that have not previously been disc
The tutorials provided here have discussed all the elements required to develop a channel in C3. `MyChannel` was intended to be as simple as possible in order to focus on C3 specifics. Channels can often be far more complicated and require longer implementations of `OnReceiveFromChannel` and `OnSendToChannel` methods. As such, the following details should be considered:
+ `OnReceiveFromChannel` is fired periodically, while `OnSendToChannel` is fired only if theres something to send though the Channel. Bear in mind that calls to both methods could be made at the same time from two different threads. Implement appropriate synchronization mechanisms if they share any non-atomic objects.
+ `OnSendToChannel` returns the number of bytes successfully sent to the channel. If its less than the size of the provided packet, but more than 63, *automatic chunking* kicks in. If a channel sends less than 64 bytes, C3 will attempt to resend the packet and therefore call `OnSendToChannel` with the same buffer again, while the complementary Channel automatically rejects the packet.
+ `OnSendToChannel` returns the number of bytes successfully sent to the channel. If its less than the size of the provided packet, but more than 63, *automatic chunking* kicks in. If a channel sends less than 64 bytes, C3 will attempt to resend the packet and therefore call `OnSendToChannel` with the same buffer again, while the complementary Channel automatically rejects the packet. This "magic" value of 64 is called *C3 Minimal MTU*.
+ `OnReceiveFromChannel` should retrieve only one packet at a time or return an empty buffer (in case theres nothing to read). An option to return more than one packet is planned to be added in future C3 releases.
+ Both methods should perform the minimal number of operations and leave as soon as possible. There is a possibility to add single-threaded Relays to C3 in the future, which means that only one thread of execution will be shared between all interfaces and all their methods. Bear in mind that one stalling Channel will block the whole Relay, until this method returns. Thats why if a Channels overrides (especially updates - `OnReceiveFromChannel`) require more time to execute, the implementation should be split into smaller pieces, *Update Delay Jitter* should be increased, and those pieces invoked in an interlaced manner.