Networking: Switch Callback to Array Reference
Opened this issue · 0 comments
AVividLight commented
Function pointers are expensive, and for networking all that we really want to do is write to an array. Let's just pass that array as a reference instead to improve performance and make Networking less dependent on main.
Remove void updateDisplayWithPeerChat(char*);
in main and pass messageToPrint
instead. This will still maintain low coupling between Networking and Display.