In netcat nc localhost 6667 if you type NI'CTRL+D'CK something the parser should be able to take both messages and parse them together. Currently only later part is used leading to unknown commands and such. Solution is simply to make a RecvParser class for each Client class, including the msg_queue. However this leads to Message in QuitCommand being destroyed before its finished as the Client gets erased.
Need to mark Client for destruction and destroy only after QuitCommand is out of scope. As a Message reference is still there. Switching to shared_ptr kept the program alive, as it should keep it alive longer, but Valgrind still complains.
In netcat
nc localhost 6667if you typeNI'CTRL+D'CK somethingthe parser should be able to take both messages and parse them together. Currently only later part is used leading to unknown commands and such. Solution is simply to make a RecvParser class for each Client class, including the msg_queue. However this leads to Message in QuitCommand being destroyed before its finished as the Client gets erased.Need to mark Client for destruction and destroy only after QuitCommand is out of scope. As a Message reference is still there. Switching to shared_ptr kept the program alive, as it should keep it alive longer, but Valgrind still complains.