increment variable of server class for each thread
Unsolved
Qt 6
-
wrote on 22 Mar 2021, 09:40 last edited by
In this example:
https://www.bogotobogo.com/Qt/Qt5_QTcpServer_Multithreaded_Client_Server.php
I want to increment the value of count (which is a variable of server class) in each thread when the client connects to the server. How can I do that?
-
In this example:
https://www.bogotobogo.com/Qt/Qt5_QTcpServer_Multithreaded_Client_Server.php
I want to increment the value of count (which is a variable of server class) in each thread when the client connects to the server. How can I do that?
@fari35 said in increment variable of server class for each thread:
How can I do that?
Emit a signal in each thread as soon as a new client connects. Connect a slot to that signal and increment the count variable there.
2/2