I am working on a C++ chat. I have a class which starts the server and I need to create a thread which handles all incoming connections and one that handles messages from each of the clients.
I need to start it from within the class so that I am also able to access the members of the class, but it is impossible with the CreateThread function since it does not handle the predefined first parameter (this) for class member functions.
I have previously written one by passing a struct with pointers to everything I needed but it was such a pain in the ass to write and fix everything while debugging so I am wondering if there is anything I can use that allows me to start it from within the class and be able to access the member functions and variables.
Thanks!