client icon indicating copy to clipboard operation
client copied to clipboard

Code talking to the server is duplicated multiple times

Open Wesmania opened this issue 9 years ago • 0 comments

The protocol we use to communicate with FAF server is very simple - sequences of 4-byte ints signifying length and data of that length. The logic that reads and writes that data, however, is duplicated a couple times around the codebase (grepping blockSize shows it very well).

We should have a single implementation that communicates its state changes and passes read blocks to a handler - possibly not even concerning itself with connecting / disconnecting the socket. Before that we need to factor out all uses of the logic from the classes that use it.

Wesmania avatar Apr 14 '17 23:04 Wesmania