I'm trying to create a multi-client server, and I managed to secure the exchange of information between the server and a single client,
but now I have to use thread, so that multiple clients can connect at the same time with the server.

I followed the instructions on the internet, but I get an error

'CreateThread': can not convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *) (void *)'

you will see that in this function, I return 0, because I do not know what to return.

1 Answer
1

You will not be able to pass a member function as a function pointer to a c-style function like this. You could use a static function that takes a pointer to this and then cast the object and call your member function from within the static function. Or, better yet, use std::thread.