self.sent_bytes
and self.ue_received_bytes
are u64 and usize
can be u32
. In case we have fucked up - difference between them can get huge, this accounts for that.
I don't actually think…
It passes to MessageWriter
the whole amount of bytes passed so far, not just after the last update. This way it's harder to mess up.
4096 is limitation on how much we can write, it's unrelated to reading and this is an arbitrary constant. Honestly I don't know what to use, but one option is to add BufReader
and read byte-by-byte.
MessageWriter
is now a proper implementation.
Also have added Link
implementation that:
- Trying to listen to a port and spawns a new handler thread for every connection;
- Currently…
But upon further consideration I agree that there is no sense in defining this as a constant.
In general I am against replacing numeric constants with magic numbers unless it is something super-obvious like 1
or just something used in tests. It's not just about conveniently refactoring code…
Using clippy is a great suggestion, but the only warnings it produces regarding files in src/link/*
are about dead-code. "unreal_config" code might be deleted (moved out into another project), so I…
MessageReader
implementation