QT4: to send a signal to a specific trade?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
Suppose, for example, what is the messenger — he's a server and client. Each client connection is done in a separate thread (QThread). Every client has a unique identifier (e.g., e-mail address of the owner).


I realize transmission of messages from one client to another is now: each thread subscribes to a signal from the server. When one client sends a message, the server emits the signal and all the threads look at the ID of the client — the trade unions, with whom he coincides with the destination, sends the message to the client. Everything is simple and works fine, but I have a suspicion that this is somewhat wrong. What if customers millions? Maybe there's a smarter way?


PS Every thread also has a unique numeric ID, assigned automatically upon creation. You can write to the database this ID and mailing address. But again — how to send the signal to trade with a specific ID?
by | 4 views

1 Answer

0 like 0 dislike
I think you need to modificirovat signal and make it integer. After this, sending a signal will need to specify the ID of the desired thread. The thread in turn will check if the value of the argument of the received signal coincides with its identifier, the process it.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
27,902 users