After realizing what I'd have to go through to build a functional "Users
online:" view, I have decided to NOT do that, especially because this
entire thing still runs on raw TCP messages for commmunication and
trying to tell apart regular messages from join/disconnect messages in
the client to properly update the possible new view would be hell.
Go audit / audit (pull_request) Successful in 1m48sDetails
I've finally managed to properly rebuild the project, it's not extremely
clean, but compared to before, it's infinitely more functional and
expandable.
Whenever a server would be stopped while the clients were connected to
it, the for loop handling the messages received by the server would
start a feedback loop as no more data could be read from "conn", thus
spawning an infinite number of byte arrays and crashing my laptop
Instead of trying to let Cobra handle the possible errors produced in
client input through bufio.NewReader(conn), I'm handling them manually
by returning the function if there's an error detected, therefore
severing the goroutine and letting the main server run normally